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

using namespace std;


int main()
{
	int n,m;
	cin>>n>>m;

	vector<pair<int,int> > a(m);
	int two =0;
	int sum1 = 0;
	for(int i=0;i<m;i++)
	{
		int temp1,temp2;
		temp1 = i+1;
		cin>>temp2;
		if(temp2==2)two++;
		sum1+=temp2;
		a[i]=make_pair(temp2,temp1);
	}
	if(sum1<n+2){cout<<"Epic fail\n";return 0;}
	if(two==m&&n==3){cout<<"Epic fail\n";return 0;}
	sort(a.begin(),a.end());

	int sum = n;
	int checker = 0;
	for(int i=m-1;i>=0;i--)
	{
		sum-=a[i].first;
		checker++;
		if(sum<=0)break;
	}
	cout<<checker<<endl;
	int ans = m-checker;
	for(int i=m-1;i>=ans;i--)
	{
		cout<<a[i].second<<' ';
	}
	return 0;
}