#include <bits/stdc++.h>
using namespace std;
long long binarySearch(vector<long long> &vec, long long num, long long n) {
  long long left = 0;
  long long right = n - 1;
  long long mid = 0;
  while (left <= right) {
    mid = (left + right) / 2;
    if (left == right) {
      break;
    }
    if (vec[mid] <= num) {
      left = mid + 1;
    } else {
      right = mid;
    }
  }
  if (vec[mid] <= num) {
    return mid + 1;
  }
  return mid;
}
int main(int argc, char const *argv[]) {
  ios_base::sync_with_stdio(false);
  long long a, b;
  cin >> a >> b;
  vector<long long> avec(a);
  for (auto &it : avec) {
    cin >> it;
  }
  sort(avec.begin(), avec.end());
  long long curr;
  map<long long, long long> answers;
  while (b--) {
    cin >> curr;
    if (answers[curr] != 0) {
      cout << answers[curr] << " ";
    } else {
      long long ans = binarySearch(avec, curr, a);
      answers[curr] = ans;
      cout << ans << " ";
    }
  }
  cout << "\n";
  return 0;
}
