var i,n,m,y,g:longint;
a:array[-1..1000008]of longint;
procedure qsort(l,r:longint);
var c,t,i,j:longint;
begin
if l>=r then exit;
c:=(l+r) div 2;
i:=l; j:=r;
repeat
while (a[i]<a[c]) do inc(i);
while a[j]>a[c] do dec(j);
if i<=j then
begin
if i<j then
begin t:=a[i]; a[i]:=a[j]; a[j]:=t; end;
inc(i); dec(j);
end;
until i>j;
qsort(l,j); qsort(i,r);
end;
function tknp(x:longint):longint;
var k,l,r:longint;
begin
l:=1; r:=n;
while l<=r do
begin
g:=(l+r) div 2;
if a[g]>x then r:=r-1
else begin k:=g ; l:=g+1; end;
end;
exit(k);
end;
begin
//assign(input,'CLIMBSTAIR.inp') ; reset(input);
//assign(output,'CLIMBSTAIR.OUT') ; rewrite(output);
readln(n,m);
for i:=1 to n do
read(a[i]);
qsort(1,n);
// for i:=1 to n do writeln(a[i]);
readln();
for i:=1 to m do
begin
read(y);
writeln(tknp(y));
end;
close(input); close(output);
end.
dmFyIGksbixtLHksZzpsb25naW50OwogICAgYTphcnJheVstMS4uMTAwMDAwOF1vZiBsb25naW50Owpwcm9jZWR1cmUgcXNvcnQobCxyOmxvbmdpbnQpOwp2YXIgYyx0LGksajpsb25naW50OwpiZWdpbgogaWYgbD49ciB0aGVuIGV4aXQ7CiBjOj0obCtyKSBkaXYgMjsKIGk6PWw7IGo6PXI7CiByZXBlYXQKIHdoaWxlIChhW2ldPGFbY10pIGRvIGluYyhpKTsKIHdoaWxlIGFbal0+YVtjXSBkbyBkZWMoaik7CiBpZiBpPD1qIHRoZW4KIGJlZ2luCiAgaWYgaTxqIHRoZW4KICBiZWdpbiB0Oj1hW2ldOyBhW2ldOj1hW2pdOyBhW2pdOj10OyBlbmQ7CiAgaW5jKGkpOyBkZWMoaik7CiBlbmQ7CiB1bnRpbCBpPmo7CiBxc29ydChsLGopOyBxc29ydChpLHIpOwplbmQ7CmZ1bmN0aW9uIHRrbnAoeDpsb25naW50KTpsb25naW50Owp2YXIgayxsLHI6bG9u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