#include <iostream>
#include <vector>
using namespace std;

int main() {
    unsigned long long int N, L;
    cin >> N >> L;

    unsigned long long int niz[N];
    int r = 0;
    bool sve= true;

    for ( unsigned long long int i = 0; i < N; i++) {
        cin >> niz[i];
    }

    for ( unsigned long long int i = 0; i < N; i++) {
        if (niz[i] < L) {
            r++;
            sve=false;
        } else {
            cout << "-1" << endl;
            return 0;
        }
    }
    cout << r << endl;

    return 0;
}