#include<bits/stdc++.h>
using namespace std;
#define int long long int
int a[100000]={0};
int find(int n,int s){
int j=n,i=0;
while(j>0&&a[i]<s){
while(i+j<n&&a[i+j]<=s)i=j;
j/=2;
}
return (i+1)*(a[i]==s);
}
signed main(){
ios::sync_with_stdio(0),cin.tie(0);
int n,k;cin>>n>>k;
for(int i=0;i<n;i++)cin>>a[i];
int s;
while(k--){
cin>>s;
cout<<find(n,s)<<"\n";
}
}