#include <stdio.h>

int main(void)
{
	int n, m;	/* n:??????????????°, m:?????§????????? */
	int max = 0;
	int price[1000];
	int i = 0;

	while (1) {
		scanf_s("%d %d", &n, &m);
		if (n == 0 && m == 0)
			break;
		else {
			for (i = 0; i < n; i++) {
				scanf_s("%d", &price[i]);
			}
			/* printf("n = %d, m = %d\n", n, m);
			for (i = 0; i < n; i++)
				printf("price[%d] = %d\n", i, price[i]);
			*/

			for (i = 0; i < n - 1; i++) {
				for (int j = i + 1; j < n; j++) {
					if (max < (price[i] + price[j]) && m >= (price[i] + price[j])) {
						max = (price[i] + price[j]);
					}
					/*printf("i = %d, j = %d, max = %d, price+ = %d\n", i, j, max, price[i] + price[j]);*/
				}
			}
			if (max == 0)
				printf("NONE\n");
			else
				printf("%d\n", max);
		}
		max = 0;

	}

	return 0;
}