#define  _USE_MATH_DEFINES

#define  rep(i, n) for(int i = 0; i < n; i++)
#define  repx(i, a, n) for(int i = a; i < n; i++)
#define  loop while(1)
#define  lli long long int
#define  aryout(ary) rep(i, ary.size()) cout << ary[i] << (i < ary.size() - 1 ? " " : "\n");
#define  arysort(v) sort(v.begin(), v.end())
#define  aryreverse(v) reverse(v.begin(),v.end())ﾎﾉ
#define  arysum(v) accumulate(v.begin(), v.end(), 0)
 
#include <iostream>
#include <algorithm>
#include <cmath>
#include <numeric>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <list>
#include <map>
#include <utility>
#include <set>

using namespace std;

vector<int> subset_sum_total(vector<int> v, int x) {
  
  int n = v.size();
  int sum = x;

  vector<int> tab1(sum + 1, 0);
  tab1[0] = 1;

  rep(i, n) {
    rep(j, sum - v[i] + 1)
      tab1[j + v[i]] += tab1[j];
  }
  return tab1;
}

int main() {

  int n, x;

  loop {
    cin >> n >> x;
    if (n + x == 0) break;

    vector<int> v(n);
    rep(i, n) cin >> v[i];

    vector<int> cost = subset_sum_total(v, x);

    for(int i = cost.size() - 1; i > 0; i--) {
      bool flag = false;
      if (cost[i] > 0) {
        flag = true;
        repx(j, 2, sqrt(i)) {
          if (i % j == 0) {
            flag = false;
            break;
          }
        }
      }
      if (flag) {
        cout << i << endl;
        break;
      }
      else if (i == 1) {
        cout << "NA" << endl;
      }
    }
  }

  return 0;
}

