#include<bits/stdc++.h>
#define For(i,m,n) for(int i=m;i<n;i++)
#define rFor(i,n,m) for(int i=n;i>m;i--)
#define r(a) read(a)
#define rr(a,b) read(a),read(b)
#define rrr(a,b,c) read(a),read(b),read(c)
using namespace std;
typedef long long ll;
typedef unsigned long long Ull;
template <class T>
void read(T &x){
T f=1;
x=0;
char ch=getchar();
while(ch=='\n'){ch=getchar();}
while(ch<'0'||ch>'9') if(ch=='-'){f=-1;ch=getchar();}
while(ch>='0'&&ch<='9') {x=(x<<1)+(x<<3)+(ch-'0');ch=getchar();}
x*=f;
}
const int MAX=1e6+9;
int n,m;
int res[MAX];
void input()
{
rr(n,m);
For(i,0,n){
r(res[i]);
}
For(i,0,m){
int tmp;
r(tmp);
int pos=lower_bound(res,res+n,tmp)-res;
if(res[pos]!=tmp) cout<<-1<<' ';
else cout<<pos+1<<' ';
}
}
int main()
{
input();
return 0;
}