#include <stdio.h>
//#include <conio.h>

int main()
{
	int N, M;
	scanf("%d %d", &N, &M);

	int *mArr = new int[M];

	for(int i = 0; i < M; i++)
		scanf("%d", &mArr[i]);
	int sum = 0,
		count = 0;
	for(int i = 0; i < M-1; i++)
	{
		for(int j = i+1; j < M; j++)
		{
			if(mArr[i] < mArr[j])
			{
				mArr[j] = mArr[j] + mArr[i];
				mArr[i] = mArr[j] - mArr[i];
				mArr[j] = mArr[j] - mArr[i];
			}
		}
	}

	while(sum < N && count < M)
	{
		if(count == 0)
			sum += mArr[count];
		else
			sum = sum + mArr[count] - 2;
		count++;
	}
	if(sum < N)
		printf("Epic fail\n");
	else
	{
		printf("%d\n", count);
		for(count; count > 0; count--)
			printf("%d ", count);
	}
	//getch();
	return 0;
}

