#include <bits/stdc++.h>
using namespace std;
int main() {
ios::sync_with_stdio(false);
cin.tie(NULL);
int N;
long long x;
cin >> N >> x;
long long a;
int pos = -1;
for (int i = 1; i <= N; i++) {
cin >> a;
if (a == x) {
pos = i; // lưu vị trí xuất hiện cuối cùng
}
}
cout << pos;
return 0;
}



