#include <iostream>

using namespace std;

int main()
{
    int n, k, x, xk;
    bool t = 0;
    cin >> n >> k;
    cin >> xk;
    if ( xk == k )
        t = 1;
    for ( int i = 1; i < n; i++ )
    {
        cin >> x;
        if ( t == 1 )
            xk = x;
        if ( x == k )
           t = 1;
    }
    cout << xk;
    return 0;
}