using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Madjionicar
{
    class Program
    {
        static void Main(string[] args)
        {
            int N, K;
            string[] x = Console.ReadLine().Split();
            N = int.Parse(x[0]);
            K = int.Parse(x[1]);
            int[] A = new int[N];
            x= Console.ReadLine().Split();
            int nadjen = 0;
            for (int i = 0; i < N; i++)
            {
                A[i] = int.Parse(x[i]);
                if(nadjen==1)
                {
                    Console.WriteLine(A[i]);
                    nadjen = 2;
                }
                if(A[i]==K && i<N-1)
                {
                    nadjen = 1;
                }
            }
            if(nadjen==0)
            {
                Console.WriteLine(A[0]);
            }
            Console.ReadKey();
        }
    }
}