#include <bits/stdc++.h>
using namespace std;
int  a[1000000],b[1000][1000],m,c,x,e,t,dem=0,n,d,k,h,g,hahihi=0;
struct T
{
    int a,loc;
    bool operator <( const T &x) const {return a<x.a;}
} q[1000000];
void input()
{
    freopen("TKNP.inp","r",stdin);
    cin>>n>>m;
    for (int i=1;i<=n;i++)
    {
        cin>>q[i].a;
        q[i].loc=i;
    }
    sort(q+1,q+n+1);
}
int nhiphan(T *q,int left,int right,int x)
{
    int mid=(left+right)/2;
    if (left>right) return -1;
    else if (q[mid].a==x) return q[mid].loc;
    else if (q[mid].a<x) nhiphan(q,mid+1,right,x);
    else if (q[mid].a>x) nhiphan(q,left,mid-1,x);
}
void solve()
{
    int ahihu=1;
    k=nhiphan(q,ahihu,n,m);
}
void output()
{
    freopen("TKNP.out","w",stdout);
    cout<<k;
}
int main()
{
    ios_base::sync_with_stdio(false);
    input();
    solve();
    output();
}

