#include <bits/stdc++.h>
using namespace std;
const int MAXN = 5e5 + 15;
const int oo = 1e9 + 7;
int N, M, T, K, Q;
int C;
int cnt[MAXN];
int p[MAXN];
int r[MAXN];
vector<int> A;
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  if (fopen("changes"
            ".inp",
            "r")) {
    freopen(
        "changes"
        ".inp",
        "r", stdin);
    freopen(
        "changes"
        ".out",
        "w", stdout);
  }
  Q = 1;
  while (Q--) {
    cin >> C >> N;
    A.clear();
    A.push_back(0);
    for (int i = 1; i <= N; i++) {
      int x;
      cin >> x;
      cnt[x] = 0;
      A.push_back(x);
    }
    for (int i : A) cnt[i]++;
    (sort(A.begin(), A.end()));
    A.erase(unique(A.begin(), A.end()), A.end());
    N = A.size() - 1;
    A.push_back(5e5 + 1);
    int ans = -1;
    for (int t = A[1]; t <= C; t++) {
      int cur = C;
      int pos = N;
      while (A[pos] >= t && cur > 0) {
        long long nxt = 1LL * A[pos] * cnt[A[pos]];
        if (nxt <= cur)
          cur -= nxt;
        else
          cur %= A[pos];
        if (cur == 0) break;
        pos = upper_bound(A.begin() + 1, A.begin() + pos, cur) - A.begin() - 1;
      }
      if (cur == 0) continue;
      cur -= t;
      pos =
          upper_bound(A.begin() + 1, A.begin() + pos + 1, cur) - A.begin() - 1;
      while (cur > 0 && pos > 0) {
        long long nxt = 1LL * A[pos] * cnt[A[pos]];
        if (nxt <= cur)
          cur -= nxt;
        else
          cur %= A[pos];
        if (cur == 0) break;
        pos = upper_bound(A.begin() + 1, A.begin() + pos, cur) - A.begin() - 1;
      }
      if (cur > 0 && pos == 0) {
        ans = t;
        break;
      }
    }
    if (ans == -1)
      cout << "Greed is good\n";
    else
      cout << ans << '\n';
  }
}
