#include <iostream>
#include<cstring>
#include<cstdio>
#include<algorithm>
#include<cmath>
using namespace std;
int a[1000010];
int lower_bound1(int A[],int left,int right,int x)
{
int mid;
while(left<right)
{
mid=(right+left)/2;
if(A[mid]<=x)
{
left=mid+1;
}
else
{
right=mid;
}
}
return left;
}
int main()
{
int n,m;
while(~scanf("%d%d",&n,&m))
{
//int a[n];
for(int i=0;i<n;i++)
{
scanf("%d",&a[i]);
}
sort(a,a+n);
int x;
int t;
for(int i=0;i<m;i++)
{
scanf("%d",&x);
t=lower_bound1(a,0,n,x);
printf("%d\n",t);
}
}
return 0;
}