#include <iostream>
#include <cstdio>
#include <string>
#include <cstring>
#include <cmath>
#include <set>
#include <vector>
#include <algorithm>
using namespace std;

const int MAX = 10005;
typedef pair <int, int> PT;
int N, M;

int main()
{
	int k;
	vector <PT> v;

	scanf("%d %d", &N, &M);
	
	for (int i = 0; i < M; i++)
	{
		scanf("%d", &k);
		v.push_back(PT(k, i + 1));
	}

	sort(v.begin(), v.end());

	vector <int> ans;

	for (int i = M - 1; i >= 0 && N > 0; i--)
	{
		N -= (v[i].first - (i < M - 1));
		ans.push_back(v[i].second);
		if (i > 0 && N > 0)
			++N;
	}

	if (N > 0)
	{
		puts("Epic fail");
	}
	else
	{
		printf("%d\n", ans.size());

		for (int i = 0; i < ans.size(); i++)
		{
			printf("%d ", ans[i]);
		}

		puts("");
	}


	return 0;
}
