#include<bits/stdc++.h>
using namespace std;
int niz[1005];

int main() {
    int n;
    long long l;
    long long br = 0;
    cin >> n >> l;
    for(int i = 1; i <= n; i++) {
        cin >> niz[i];
    }
    for(int i = 1; i <= n; i++) {
        if(niz[i] > l) {
           br++;
        }
   else if(niz[i] == l) {
           br++;
           break;
        }
   else if(niz[1] == 1 and l == 1) br = 1;
   }
     if(br == n and br != 1) cout << -1 << endl;
else if(br == 0 || br == 0) cout << 1 << endl;
else cout << br << endl;
  return 0;
}