#include <bits/stdc++.h>
#define ll long long
using namespace std;
long long n, l, a;
int Niz[1005];

int main(){
  cin >>n >>l;

  for(int i = 1; i <= n; i++)
    cin >>Niz[i];


  for(int j = 1; j <= n; j++){
    if(l < Niz[j])
      a++;
    if(l == Niz[j]){
      a++;
      break;
    }
  }
  if(a == n && (a == 1 && n == 1))
    cout <<1 <<endl;
  else if(a == n)
    cout <<-1 <<endl;
  else if(l > Niz[1])
    cout <<1 <<endl;
  else
    cout <<a <<endl;

  return 0;
}