import java.util.Scanner

object Main {

  def solve(sc: => Scanner): Unit = {
    val N, M = sc.nextInt
    if (N != 0 && M != 0) {
      try {
        println(Array.fill[Int](N)(sc.nextInt).combinations(2).map((X) => X(0) + X(1)).filter(X => X <= M).max)
      } catch {
        case _: Throwable => println("NONE")
      }
      solve(sc)
    }
  }

  def main(args: Array[String]): Unit = {
    val sc: Scanner = new Scanner(System.in)
    solve(sc)
  }
}