#include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>

using namespace std;

typedef pair<int, int> pii;

void solve() {
	int N, M;
	cin >> N >> M;
	vector<pii> k(M);
	for (int i = 0; i < M; i++) {
		cin >> k[i].first;
		k[i].second = i + 1;
	}
	
	sort(k.begin(), k.end());
	reverse(k.begin(), k.end());
	k.push_back(pii(1, 0));
	
	int can = k[0].first;
	for (int i = 1; i <= M; ++i) {
		if (can >= N) {
			cout << i << endl;
			for (int j = 0; j < i; ++j) {
				if (j)
					cout << ' ';
				cout << k[j].second;
			}
			cout << endl;
			return;
		}
		can += k[i].first - 2;
	}
	
	cout << "Epic fail" << endl;
}

int main() {
	solve();
	
	return 0;
}
