#include<stdio.h>
int main(void){
    int n,m,i,j,total,max,s[1000];
    while(1){
        total=0;
        max=0;
        scanf("%d",&n);
        scanf("%d",&m);
        if(n==0){
            break;
        }
        for(i=0;i<n;i++){
            scanf("%d",&s[i]);
        }
        for(i=0;i<n;i++){
            total=s[i];
            for(j=i+1;j<n;j++){
                if((max<total + s[j])&&(total+s[j]<=m)){
                    max=total+s[j];
                }
            }
        }
        if(max!=0){
            printf("%d\n",max);
        }else{
            printf("NONE\n");
        }
    }
    return 0;
    
}
