/*
  AOJ #1616 
  title:Taro's shopping
  @kankichi57301
 */
int n,m;
#include <stdio.h>
#include <stdlib.h>
#define max(x,y) (((x)>(y))?(x):(y))
int n,m;
int a[1001];

int comp( const void * a , const void * b ) {

  if( *( int * )a > *( int * )b ) {
    return 1;
  }
  else
  if( *( int * )a == *( int * )b ) {
    return 0;
  }
  return -1;
}

int solve()
{
  int l,h,ret;
  
  if(a[0]+a[1]>m)
    return(0);
  for(l=ret=0,h=n-1;l<n-1;l++)
  {
    //printf(":%d %d\n",a[l],a[h]);
    for(;h>l;h--)
   
	if(a[h]+a[l]<=m)
	{
	  ret=max(ret,a[h]+a[l]);
	  break;
	}
  }
  return(ret);
}

int main()
{
  int i,ret;

  while(1)
    {
      scanf("%d %d",&n,&m);
      if(n==0 && m==0)
	break;
      for(i=0;i<n;i++)
	scanf("%d",&a[i]);
      qsort(a,n,sizeof(int),comp);
      
      ret=solve();
      if(ret==0)
	printf("NONE\n",ret);  
      else
	printf("%d\n",ret);
    }
  return(0);
}

