#include <stdio.h>

int main(void)
{
    int n, m;
    int a[1000];
    int i, j;
    int max;

    while (1){    
        scanf("%d%d", &n, &m);
        if (n == 0 && m == 0){
            break;
        }
    
        for (i = 0; i < n; i++){
            scanf("%d", &a[i]);
        }
        
        max = -1;
        for (i = 0; i < n - 1; i++){
            for (j = i + 1; j < n; j++){
                if (a[i] + a[j] <= m){
                    if (max < a[i] + a[j]){
                        max = a[i] + a[j];
                    }
                }
            }
        }
        
        if (max == -1){
            printf("NONE\n");
        }
        else {
            printf("%d\n", max);
        }
    }
    
    return (0);
}

