#include <bits/stdc++.h>
using namespace std;
long long int a[1000000];
long long int b[1000000];
int main() {
  long long int n, m;
  cin >> n >> m;
  for (long long int i = 0; i < n; i++) cin >> a[i];
  for (long long int i = 0; i < m; i++) cin >> b[i];
  sort(&a[0], &a[n]);
  int mid = 0;
  for (long long int i = 0; i < m; i++) {
    int x = b[i];
    int mid = upper_bound(a, a + n, x) - a;
    cout << mid << '\n';
  }
}
