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

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

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

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

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

    return 0;
}