#include <bits/stdc++.h>

using namespace std;


int main(int argc, char** argv) 
{
	long long  n, k,a, t;
	bool b = false;
	
	cin>>n;
	cin>>k;
	cin>>a;
	if(a == k) b = true;
	for(long long i=1; i<n; i++)
	{	
	cin>>t;
	if(b == true)
	{
	a = t;	
	}
	if(t == k)
	{
	b = true;
	}
	
	
	}
	cout<<a;
	return 0;
	
}