#include <stdio.h>

int main() {
    int N, L, br;
    br = 0; 
    scanf("%d", &N);
    scanf("%d", &L); 

    int x[N];  
    for(int i = 0; i < N; i++) {
        scanf("%d", &x[i]); 
        
        if (L > x[i]) 
        br++; 
        else if(x[i] > L)
        {br = -1;
        break;}
    }

    printf("%d", br);
    return 0;