#include <bits/stdc++.h>
using namespace std;

int a[1010];
int n, m;
int main(){
  while(true){
    cin >> n >> m;
    if(n == 0 && m == 0) break;
    for(int i = 0; i < n; i++) cin >> a[i];

    int ans = 0;
    int tmp = 0;
    for(int i = 0; i < n; i++){
      for (int j = i + 1; j < n; j++){
        tmp = a[i] + a[j];
        if(tmp <= m){
          ans = max(ans, tmp);
        }
      }
    }
    if(ans == 0){
      cout << "NONE" << endl;
    } else {
      cout << ans << endl;
    }
  }
}

