#include using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(nullptr); int N, M; cin >> N >> M; vector A(N); for (int i = 0; i < N; ++i) { cin >> A[i]; } sort(A.begin(), A.end()); for (int i = 0; i < M; ++i) { long long b; cin >> b; auto lower = lower_bound(A.begin(), A.end(), b); auto upper = upper_bound(A.begin(), A.end(), b); if (i > 0) cout << ' '; cout << (upper - lower); } cout << endl; return 0; }