/* -*- coding: utf-8 -*- * * 3197.cc: No.3197 Frequency Counter - yukicoder */ #include #include using namespace std; /* constant */ const int MAX_N = 200000; /* typedef */ /* global variables */ int as[MAX_N]; /* subroutines */ /* main */ int main() { int n; scanf("%d", &n); for (int i = 0; i < n; i++) scanf("%d", as + i); sort(as, as + n); int qn; scanf("%d", &qn); while (qn--) { int x, k; scanf("%d%d", &x, &k); int i = lower_bound(as, as + n, x) - as; int j = upper_bound(as, as + n, x) - as; if (j - i >= k) puts("Yes"); else puts("No"); } return 0; }