#include <iostream>
#include <cmath>
#include <vector>
#include <utility>
#include <algorithm>
#include <fstream>

using namespace std;
int main()
{
	ifstream fin;
	ofstream fout;
	fin.open("input.txt");
	fout.open("output.txt");

	int n,m,sum1=0;
	fin>>n>>m;

	vector<pair<int,int> > a(m);

	for(int i=0;i<m;i++)
	{
		int temp1,temp2;
		temp2 = i+1;
		fin>>temp1;
		sum1+=temp1;
		a[i]=make_pair(temp1,temp2);
	}

	if(sum1<n+2){fout<<"Epic fail\n";return 0;}	
	
	sort(a.begin(),a.end());
	
	int checker = 0;
	int sum = n;
	for(int i=m-1;i>=0;i--)
	{
		sum-=a[i].first;
		checker++;
		if(sum<=0)break;
	}

	int ans = m-checker;

	fout<<checker<<endl;
	for(int i=m-1;i>=ans;i--)
	{
		fout<<a[i].second<<' ';
	}
	fin.close();
	fout.close();
	return 0;
}