#!/usr/bin/env python3
arr = []
n,m = input().split()
arr = input().split()
arr.reverse()
try:
    occurance = len(arr) - arr.index(m)
except:
    occurance = -1
print(occurance)

1e61741e4df787d3ce4075f03516ab71b608c12e
<mask token>

<mask token>
arr.reverse()
try:
    occurance = len(arr) - arr.index(m)
except:
    occurance = -1
print(occurance)

arr = []
n, m = input().split()
arr = input().split()
arr.reverse()
try:
    occurance = len(arr) - arr.index(m)
except:
    occurance = -1
print(occurance)

#!/usr/bin/env python3
arr = []
n,m = input().split()
arr = input().split()
arr.reverse()
try:
    occurance = len(arr) - arr.index(m)
except:
    occurance = -1
print(occurance)
