
object Main extends App {

  import scala.io.StdIn._
  import scala.math._
  solve
  def solve: Unit = {
    val Array(n, m) = readLine.trim.split(' ').map(_.toInt)
    if (n == 0) return
    val values = readLine.trim.split(' ').map(_.toInt).filter(_ <= m).sorted
    println(
      values.indices.flatMap{i ⇒
        val idx = upperBound(values, m - values(i)) - 1
        if (i != idx && idx >= 0) Some(values(i) + values(idx))
        else None
      } match {
        case a if a.nonEmpty ⇒ a.max
        case _ ⇒ "NONE"
      }
    )
    solve
  }
  def upperBound[T](array: Array[T], target: T, leftLimit: Int, rightLimit: Int)(implicit  ord: Ordering[T]): Int = {
    var left = leftLimit
    var right = rightLimit
    while (left < right){
      val mid = (left + right) / 2
      if (ord.compare(array(mid), target) <= 0){
        left = mid + 1
      }else {
        right = mid
      }
    }
    right
  }
  def upperBound[T](array: Array[T], target: T)(implicit ord: Ordering[T]): Int = {
    upperBound(array, target, 0, array.length)
  }
  implicit class Extension[T](val value :T){
    def also(func: T ⇒ Unit): T = {
      func(value)
      value
    }
    def let[R](func: T ⇒ R): R = func(value)
  }
}
