#include #include using namespace std; struct MyHash { size_t operator()(long long val) const { return val ^ 0x100007d1; } }; int main() { int n, m; unordered_map cnt; cin >> n >> m; while (n--) { long long a; cin >> a; cnt[a]++; } while (m--) { long long b; cin >> b; cout << cnt[b] << " \n"[!m]; } return 0; }