#include <iostream>

using namespace std;
int k,n, r, i,d,p;
int main()
{
    cin>>n;
    cin>>r;
    for (i=1;i<=n;i++)
    {cin>>d;
    if (i==1)
    k=d;
    if (p==1)
    {cout<<d;
        p=0;
    }
        if (d==r)
        {p=1;}
    }
    if (p==1)
    cout<<k;
    return 0;
}