#include <bits/stdc++.h>
using namespace std;
ifstream fi("tknp.inp");
ofstream fo("tknp.out");
long int tknp(long int a[],long int k,long int l,long int r)
{
	if(l>r)
	return -1;
	else
	{
	int m=(l+r)/2;

        if(a[m] == k)     return m;

        if(a[m] > k)      return tknp(a, k, l, m - 1);

        if(a[m] < k) 
            return tknp(a, k, m + 1, r);
        }}
int main() {
	long int n,k,a[100000];
	fi>>n>>k;
	for(long int i=1;i<=n;i++)
	{
		fi>>a[i];
	}
fo<<tknp(a,k,1,n);

	return 0;
}