#include <bits/stdc++.h>

using namespace std;

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    int N,L;
    cin>>N>>L;
    int H[N];
    int rez=-1;
    for(int i=1;i<N;i++)
    {
        cin>>H[i];
        if(H[i]<=L)
        {
            rez=i;
            break;
        }
        else
        if(H[i]!=L)
            rez =-1;
    }
    cout<<rez<<endl;
}