#include <bits/stdc++.h>
using namespace std;
map<int, int> M;
int c, n;
int W[1000000];
int ile[1000000];
int cowziac[1000000];
int cnt;
bool check(int moneta) {
  int myc = c;
  int mycnt = cnt - 1;
  while (myc != 0 && mycnt != -1) {
    if (moneta >= W[mycnt] && moneta <= myc) {
      myc -= moneta;
      moneta = 0;
    }
    if (W[mycnt] <= myc) {
      myc -= min(ile[mycnt], myc / W[mycnt]) * W[mycnt];
      --mycnt;
    } else {
      mycnt = cowziac[myc];
    }
  }
  return myc != 0;
}
int main() {
  scanf("%d%d", &c, &n);
  int in;
  for (int i = 0; i < n; ++i) {
    scanf("%d", &in);
    ++M[in];
  }
  cnt = 0;
  for (auto it : M) {
    W[cnt] = it.first;
    ile[cnt] = it.second;
    ++cnt;
  }
  int back = cnt - 1;
  for (int i = c; i >= 0; --i) {
    while (back > -1 && W[back] > i) --back;
    cowziac[i] = back;
  }
  for (int i = 0; i < c; ++i)
    if (check(i)) {
      printf("%d\n", i);
      return 0;
    }
  puts("Greed is good");
}
