#define M_PI       3.14159265358979323846
#define M_PI_2     1.57079632679489661923
#include <iostream>
#include <string>
#include <stdio.h>
#include <math.h>
#include <algorithm>
using namespace std;

struct node
{
	int countPorts;
	int index;
};

node mas[310];

void qs(int l, int r)
{
	if (l == r) return;
	int indBuf = (l+r)/2;
	int i = l, j = r;
	while (j > i)
	{
		while (mas[i].countPorts < mas[indBuf].countPorts && i < j) i++;
		while (mas[j].countPorts > mas[indBuf].countPorts && j > i) j--;
		if (i < j)
		{
			if (i == indBuf) indBuf = j;
			else if (j == indBuf) indBuf = i;
			node buf = mas[i];
			mas[i] = mas[j];
			mas[j] = buf;
			i++;
			j--;
		}
	}
	if (l < indBuf-1) qs(l, indBuf - 1);
	if (r > indBuf+1) qs(indBuf + 1, r);
}

int main()
{
	int n, m;
	cin >> n >> m;
	int sumK = 0;;
	for (int i = 0; i < m; i++)
	{
		cin >> mas[i].countPorts;
		mas[i].index = i+1;
		sumK += mas[i].countPorts;
	}
	
	//if (sumK < n + m -1)
	//{
	//	cout << "Epic fail";
	//	return 0;
	//}

	qs(0, m-1);

	int k = m - 1;
	while (n > 0)
	{
		if (k < 0) break;
		if (n > mas[k].countPorts)
		{
			n = n - mas[k].countPorts + 2;
			k--;
		}
		else
		{
			n -= mas[k].countPorts;
		}
	}
	
	if (k < 0)
	{
		cout << "Epic fail";
	}
	else
	{
		cout << m - k << endl;
		for (; k < m; k++)
		{
			cout << mas[k].index << " ";
		}
	}
	//getchar();
	//getchar();
	return 0;
}