#include<stdio.h>
#include<stdlib.h>
int main(){
	int n, m;
	int first, second;
	int max;
	int work;
	int i;
	int* list;
	
	while( 1 ){
		scanf( "%d %d", &n, &m );
		if(( n == 0) && ( m == 0 )){
			break;
		}
		list = ( int* )malloc( sizeof( int ) * n );
		for( i = 0; i < n; i++ ){
			scanf( "%d",  (list + i ));
		}
		
		max = 0;
		for( i = 0; i < n; i++ ){
			if( max < *( list + i ) && (( m / 2 ) >= *( list + i ))){
				work = *( list + i );
				*( list + i ) = max;
				max = work;
			}
		}
		first = max;

		max = 0;
		for( i = 0; i < n; i++ ){
			if( max < *( list + i ) && (( m / 2 ) >= *( list + i ))){
				work = *( list + i );
				*( list + i ) = max;
				max = work;
			}
		}
		second = max;

		if(( first == 0 ) || ( second == 0 )){
			printf( "NONE\n" );
		}
		else{
			printf( "%d", first + second );
		}
		free( list );
	}
	return 0;
}

