//#include "stdafx.h"
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <iostream>

using namespace std;

typedef long long ll;

struct Cell {
	int k, n;
};

bool compare(Cell& a, Cell& b)
{
	return a.k > b.k ? true : false;
}

int main()
{
	int N, M, i, j;
	struct Cell K[310];

	cin >> N >> M;
	for (i = 0; i < M; ++i) {
		cin >> K[i].k;
		K[i].n = i + 1;
	}

	sort(&K[0], &K[M], compare);

	for (i = 1; i < M; ++i)
		--K[i].k;

	/*for (i = 0; i < M; ++i)
		cout << K[i].k << ' ';

	cin.get();cin.get();
	return 0; */

	for (i = 0; i < M; ++i) {
		N -= K[i].k;
		if (N <= 0) {
			cout << i + 1 << endl;
			for (j = 0; j <= i; ++j) {
				cout << K[j].n << ' ';
			}
			//cin.get(); cin.get();
			return 0;
		}

		++N;
	}

	cout << "Epic fail";
	//cin.get(); cin.get();

	return 0;
}