#include <stdio.h>

int n, m;
int a[1024];

int main(void) {
	while (scanf("%d%d", &n, &m) == 2 && (n|m) != 0) {
		int i, j;
		int max = -1;
		for (i = 0; i < n; i++) {
			if (scanf("%d", &a[i]) != 1) return 1;
		}
		for (i = 0; i < n; i++) {
			for (j = i + 1; j < n; j++) {
				int sumipe = a[i] + a[j];
				if (sumipe <= m && max < sumipe) max = sumipe;
			}
		}
		if (max < 0) puts("NONE"); else printf("%d\n", max);
	}
	return 0;
}

