#include <stdio.h>
#include <stdlib.h>
#define ll long long
#define rep(i,l,r)for(ll i=l;i<r;i++)
#define max(p,q)((p)>(q)?(p):(q))
int upll(const void*a, const void*b){return*(ll*)a<*(ll*)b?-1:*(ll*)a>*(ll*)b?1:0;}
void sortup(ll*a,int n){qsort(a,n,sizeof(ll),upll);}

ll a[1010];
int main(){
	ll n,m;
	while(scanf("%lld%lld",&n,&m),n){
		rep(i,0,n)scanf("%lld",a+i);
		sortup(a,n);
		ll M=0;
		ll r=n-1;
		rep(l,0,n){
			while(r>l&&a[l]+a[r]>m)r--;
			if(l==r)break;
			M=max(M,a[l]+a[r]);
		}
		if(M)printf("%lld\n",M);
		else puts("NONE");
	}
}
