#include<bits/stdc++.h>
using namespace std;
ifstream fi("TKNP.inp");
ofstream fo("TKNP.out");
int tknp(vector<int64_t>a,int l,int r,int64_t k){
   if(l>r)return -1;
   int mid=(l+r)/2;
   if(k==a[mid])return mid+1;
   if(k<a[mid])return tknp(a,l,mid-1,k);
   if(k>a[mid])return tknp(a,mid-1,r,k);
}
int main(){
   int n;
   int64_t k;
   fi>>n>>k;
   vector<int64_t>a(n);
   for(int i=0;i<n;++i)fi>>a[i];
   fo<<tknp(a,0,n-1,k);
}
