import java.util.*;
import java.io.*;

public class Main implements Runnable {

	static class Hub implements Comparable<Hub> {
		int capacity;
		int idx;

		public Hub(int capacity, int idx) {
			this.capacity = capacity;
			this.idx = idx;
		}

		@Override
		public int compareTo(Hub second) {
			return second.capacity - this.capacity;
		}
	}

	Scanner in;
	PrintWriter out;

	void solve() {
		int nUsers = in.nextInt();
		int nHubs = in.nextInt();
		Hub hubs[] = new Hub[nHubs];
		for (int i = 0; i < hubs.length; i++) {
			hubs[i] = new Hub(in.nextInt(), i + 1);
		}
		Arrays.sort(hubs);
		if (nUsers <= hubs[0].capacity) {
			out.println("1 " + hubs[0].idx);
			return;
		}
		ArrayList<Hub> ans = new ArrayList<Hub>();
		for (int i = 0; i < nHubs; i++) {
			if (i == 0) {
				nUsers -= hubs[0].capacity - 1;
				ans.add(hubs[i]);
				if (nUsers <= 0) {
					break;
				}
			} else {
				if (nUsers <= 0) {
					break;
				}
				if (nUsers <= hubs[i].capacity - 1) {
					ans.add(hubs[i]);
					nUsers -= hubs[i].capacity - 1;
					break;

				} else {
					if (i != hubs.length - 1) {

						nUsers -= hubs[i].capacity - 2;
						ans.add(hubs[i]);
					} else {
						nUsers -= hubs[i].capacity - 1;
						ans.add(hubs[i]);
					}
				}

			}
		}
		if (nUsers > 0) {
			out.print("Epic fail");
		} else {
			out.println(ans.size());
			for (Hub hub : ans) {
				out.print(hub.idx + " ");
			}
		}

	}

	public void run() {
		in = new Scanner(System.in);
		out = new PrintWriter(System.out);
		try {
			solve();
		} finally {
			out.close();
		}
	}

	public static void main(String args[]) {
		new Main().run();
	}

}
