#include<stdio.h>

int main(void)
{
  int i,j,n,m,p[1000],S,S1;

  while(1)
    {
      scanf("%d%d",&n,&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;j++)
	    {
	      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;
}