#include <bits/stdc++.h>
using namespace std;
int bs(int start, int end, long long x, pair<long long, int> v[]) {
  int mid = (start + end) / 2;
  if (start > end) {
    if (end >= 0)
      return v[end].second;
    else {
      return 0;
    }
  }
  if (v[mid].first == x) {
    return v[mid].second;
  }
  if (v[mid].first > x) {
    return bs(start, mid - 1, x, v);
  } else {
    return bs(mid + 1, end, x, v);
  }
}
int main() {
  int n, m;
  cin >> n >> m;
  long long a[n], b[m];
  for (int i = 0; i < n; i++) {
    scanf("%I64d", &a[i]);
  }
  for (int i = 0; i < m; i++) {
    scanf("%I64d", &b[i]);
  }
  sort(a, a + n);
  int xx = 1;
  for (int i = 1; i < n; i++) {
    if (a[i] != a[i - 1]) {
      xx++;
    }
  }
  pair<long long, int> v[xx];
  xx = 1;
  pair<long long, int> p;
  p.first = a[0];
  p.second = 1;
  v[0] = p;
  for (int i = 1; i < n; i++) {
    if (a[i] == v[xx - 1].first) {
      v[xx - 1].second = i + 1;
    } else {
      pair<long long, int> p;
      p.first = a[i];
      p.second = i + 1;
      v[xx] = p;
      xx++;
    }
  }
  for (int i = 0; i < m; i++) {
    if (i != m - 1)
      printf("%d ", bs(0, xx - 1, b[i], v));
    else
      printf("%d\n", bs(0, xx - 1, b[i], v));
  }
  return 0;
}
