#include <bits/stdc++.h>
using namespace std;
long long a[200001];
long long search(long long l, long long h, long long target) {
  if (h - l <= 1) {
    if (a[l] > target)
      return l;
    else
      return h;
  }
  long long mid = (l + h) / 2;
  if (a[mid] > target)
    return search(l, mid, target);
  else
    return search(mid + 1, h, target);
}
int main() {
  int N, M;
  cin >> N >> M;
  for (int i = 0; i < N; i++) {
    cin >> a[i];
  }
  sort(a, a + N);
  for (int j = 0; j < M; j++) {
    int b;
    cin >> b;
    if (a[N - 1] > b) {
      cout << search(0, N - 1, b) << " ";
    } else {
      cout << N << " ";
    }
  }
  return 0;
}
