#include <iostream>
#include <cstdio>

#include <algorithm>
#include <cmath>
#include <cstring>

#include <vector>
#include <map>
#include <set>
#include <queue>

using namespace std;

#define pb(x) push_back(x)
#define mp(a, b) make_pair (a, b)
#define sqr(x) ((x)*(x))

const int MAXM = 1000;

int a[MAXM+5];
int id[MAXM+5];

bool cmp (int x, int y) { return a[x] < a[y]; }

int main () {
	//freopen ("input.txt", "r", stdin);
	//freopen ("output.txt", "w", stdout);

	int n, m; scanf ("%d%d", &n, &m);
	for (int i = 0; i < m; i++) scanf ("%d", a + i);
	for (int i = 0; i < m; i++) id[i] = i;

	sort (id, id + m, cmp);

	int cnt = a[id[m - 1]]; int i = m - 2;
	for (; cnt < n && i >= 0; i--)
		cnt += a[id[i]] - 2;	
	
	if (cnt < n) {
		printf ("Epic fail"); return 0;
	}

	printf ("%d\n", m - 1 - i);
	for (i++; i < m; i++) printf ("%d ", id[i] + 1);

	return 0;
}