#include <fstream>
using namespace std;
ifstream f1("tknp.inp");
ofstream f2("tknp.out");
long a[10000];
long n,k;
long tk(long n,long d,long c)
{
    if (n == a[(d+c)/2]) return (d+c)/2;
    if (d > c) return -2;
    if (n > a[(d+c)/2]) return tk(n,(d+c)/2 + 1,c);
    if (n < a[(d+c)/2]) return tk(n,d,(d+c)/2 - 1);
}
int main()
{
    f1 >> n >> k;
    for (long i = 0; i < n; i++) f1 >> a[i];
    f2 << tk(k,0,n-1)+1;
    return 0;
}
