#include<stdio.h>

int main(void){
    int i,j,n,m,p[1000],s,s1;
    
    while(1){
    scanf("%d",&n);
    scanf("%d",&m);
    if(n==0&&m==0){
        break;
    }
    for(i=0;i<=n-1;i++){
    scanf("%d",&p[i]);
    }
    s1=0;
    for(i=0;i<=n-1;i++){
        for(j=i+1;j=n-1;i++){
            s=p[i]+p[j];
            if(s<=m&&s1<s){
                s1=s;
            }
        }
    }
    if(s1==0){
        printf("NONE\n");
    }else{
        printf("%d\n",s1);
         }
    }
    return 0;
}
