#include <bits/stdc++.h>
using namespace std;
const int N = 200010;
int c, a[N], n, C[N], b[N];
bool pd[N];
int main() {
  scanf("%d", &c);
  scanf("%d", &n);
  for (int i = 0; i < n; i++) scanf("%d", a + i);
  sort(a, a + n);
  for (int i = 0; i < n; i++) b[i] = a[i];
  int tot = 0;
  for (int i = 0; i < n; i++) {
    if (i == 0 || b[i] != b[i - 1]) b[tot++] = b[i];
    C[tot - 1]++;
  }
  int tmp;
  pd[0] = 1;
  for (int i = 1, j = -1; i < c; i++) {
    while (j + 1 < tot && b[j + 1] <= i) j++;
    tmp = i;
    for (int k = j; k >= 0 && tmp > 0; k--) {
      tmp -= b[k] * min(tmp / b[k], C[k]);
      if (tmp < b[0]) break;
      if (tmp < b[k]) {
        if (pd[tmp]) tmp = 0;
        break;
      }
    }
    pd[i] = tmp == 0;
  }
  tmp = c;
  int ans = 10000000;
  a[n] = c - 1;
  for (int i = n - 1; i >= 0; i--) {
    for (int j = a[i + 1] - 1; j >= a[i]; j--)
      if (j < tmp && !pd[tmp - j]) ans = j;
    if (a[i] <= tmp) tmp -= a[i];
  }
  if (ans == 10000000)
    puts("Greed is good");
  else
    cout << ans << endl;
  return 0;
}
