#include<iostream>
#include<vector>
using namespace std;


int main()
{
	vector<bool> totalValue;
	totalValue.reserve(1000000);

	while(1)
	{
		
		for(int i = 0; i < 10000001; i++)
		{
			totalValue[i] = false;
		}
		totalValue[0] = true;
		int n;
		int x;
		cin >> n >> x;
		if(n == 0 && x == 0)
		{
			break;
		}
		for(int i = 0; i < n; i++)
		{
			int value;
			cin >> value;

			for(int j = 0; j <= x; j++)
			{
				if(totalValue[j] == true && j + value <= x + 1)
				{
					totalValue[j + value] = true;
				}
			}
		}
		bool NA = true;
		for(int i = x; i >= 0; i--)
		{
			if(totalValue[i] == false)
			{
				cout << i << endl;
				NA = false;
				break;
			}
		}
		if(NA)
		{
			cout << "NA" << endl;
		}


	}


}