// #pragma comment(linker, "/STACK:64000000")
#include <iostream>
#include <cstdio>
#include <string>
#include <cstring>
#include <cstdlib>
#include <vector>
#include <algorithm>
#include <queue>
#include <map>
#include <set>

using namespace std;

#define mp make_pair
#define ll long long
#define pb push_back

int n, m;
vector< pair<int, int> > v;

int main() {
	// freopen("input.txt", "r", stdin);
	cin >> n >> m;

	for (int i = 0; i < m; i++) {
		int t;
		cin >> t;
		v.pb(mp(t, i + 1));
	}

	sort(v.rbegin(), v.rend());

	int rem = n;
	vector<int> ans;
	for (int i = 0; i < m; i++) {
		if (i == 0) {
			if (rem <= v[i].first) {
				rem = 0;
				ans.push_back(v[i].second);
				break;
			}
			else {
				rem -= (v[i].first - 1);
				ans.push_back(v[i].second);
			}
		}
		else {
			if (rem <= v[i].first - 1) {
				rem = 0;
				ans.push_back(v[i].second);
				break;
			}
			else {
				rem -= (v[i].first - 2);
				ans.push_back(v[i].second);
			}
		}
	}

	if (rem > 0) {
		cout << "Epic fail" << endl;
	}
	else {
		cout << ans.size() << endl;
		for (int i = 0; i < ans.size(); i++) {
			cout << ans[i] << ' ';
		}
	}

	return 0;
}
/*
10 3
5 5 4

10 2
48 10

2 5
2 2 2 2 2

10 1
9

10 2
5 6

20 2
11 11
*/