#include <iostream>
using namespace std;
int N, K;
int main() {
    cin.tie(NULL);
    ios::sync_with_stdio(false);
    cin >> N >> K;
    int b, c;
    cin >> b;
    c = b;
    for (int i = 1; i < N; i++) {
        if (b == K) {
            cin >> b;
            cout << b;
            return 0;
        }
        cin >> b;
    }
    cout << c;
    return 0;
}