using System;

class Program {
    static void Main(string[] args) {
     int N;
     int K;
    string[] unos = Console.ReadLine().Split();
      N = int.Parse(unos[0]);
      K = int.Parse(unos[1]);
      string[] unos2 = Console.ReadLine().Split();
      if(int.Parse(unos2[N-1]) == K){
        Console.WriteLine(unos[0]);
      }else{
      for(int i = 0;i<N;i++){
        if(int.Parse(unos2[i]) == K)
        {
          Console.WriteLine(unos2[i+1]);
        }
      }
      }
      }
}