#include <bits/stdc++.h>
using namespace std;

int main()
{
    long long n, x, a;
    cin >> n >> x;
    vector<long long> v;
    for(int i = 0; i < n; i++)
    {
        cin >> a;
        v.push_back(a);
    }
    v.push_back(v[0]);
    cout<< *(find(begin(v), end(v), x) + 1);

    return 0;
}