#include <iostream>
#include <cmath>
#include <vector>
#include <algorithm>
#include <string>
#include <map>
#include <set>

using namespace std;


int main() {


	int n, k;
	cin >> n >> k;

	vector<int> arr(n);

	for (auto &x : arr)
		cin >> x;

	arr.push_back(arr[0]);

	for (int i = 0; i < n; i++) {
		if (arr[i] == k) {
			cout << arr[i+1];
			break;
		}
	}
	

	return 0;
}