#include<stdio.h>
#include<stdlib.h>
int main(){
	int n, m;
	int chose1, chose2;
	int i;
	int* list;
	
	while( 1 ){
		scanf( "%d %d", &n, &m );
		if(( n == 0) && ( m == 0 ))
		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 ))){
				max = &( list + i );
				chose1 = i;
			}
		}
		
		&( list + chose1 ) = 0;
		max = 0;
		for( i = 0; i < n; i++ ){
			if(( max < &( list + i )) && (( m - &( list + chose1 )) <= &( list + i ))){
				max = &( list + i );
				chose2 = i;
			}
		}
		
		if(( &( list + chose1 ) == 0 ) || ( &( list + chose2 ) == 0 )){
			printf( "NONE\n" );
		}
		else{
			printf( "%d\n", &( list + chose1 ) + &( list + chose2 ));
		}
		free( list );
	}
	return 0;
}

