#include<bits/stdc++.h>
using namespace std;
long long n,m,a[1000009],s,x;
int main(){
scanf("%d %d",&n,&s);
for(long long i=1;i<=n;i++){
scanf("%d",&a[i]);
}
long long l=1,r=n;
while(s--){
scanf("%d",&m);
x=0;
while(r>=l){
int mid=(l+r)/2;
if(a[mid]m){
cout<<mid<<" ";
x=1;
break;
}
else if(a[mid]>m)r=mid-1;
else l=mid+1;
}
if(x0)
cout<<-1<<" ";
}
return 0;
}