#include <bits/stdc++.h>

using namespace std;

ifstream fi ("tknp.inp");
ofstream fo ("tknp.out");

int tim(int a[10000], int k, int vt1, int vt2){
  if (a[(vt1+vt2)/2]==k){return (vt1+vt2)/2;}
  else if (vt2<vt1){return -1;}
  else if (a[(vt1+vt2)/2]>k){return tim(a,k,vt1,(vt1+vt2)/2-1);}
  else if (a[(vt1+vt2)/2]<k){return tim(a,k,(vt1+vt2)/2+1,vt2);}
}

int main(){
 int n,k;
 fi>>n>>k;
 int a[n];
 for (int i=1;i<=n;i++){fi>>a[i];}
 fo<<tim(a,k,1,n);
    return 0;
}
