from collections import Counter, deque, defaultdict from heapq import heapify, heappop, heappush, nlargest, nsmallest from bisect import bisect_left, bisect, bisect_right from copy import deepcopy from time import perf_counter import sys from typing import Any, List, Callable def debug(*args, sep=" ", end="\n") -> None: print(*args, sep=sep, end=end, file=sys.stderr) def yn(b): print('Yes' if b else 'No') return b def gcd(a, b): a = abs(a); b = abs(b) if a < b: a, b = b, a while b > 0: a, b = b, a % b return a def lcm(a, b): return a * b // gcd(a, b) def main(): global inf, MOD input = sys.stdin.read().split() ptr = 0 inf = float("inf") MOD = 998244353 N = int(input[ptr]); ptr += 1 A = list(map(int, input[ptr:ptr + N])); ptr += N C = Counter(A) Q = int(input[ptr]); ptr += 1 for _ in range(Q): x, k = map(int, input[ptr:ptr + 2]); ptr += 2 yn(C[x] >= k) if __name__ == "__main__": main()