from collections import Counter N = int(input()) A1 = sorted(list(map(int, input().split()))) A2 = Counter(A1) Q = int(input()) for _ in range(Q): A = A2.copy() B = list(map(int, input().split())) for i in range(B[0],B[1]+1): A[i] -= 1 for i in range(B[2],B[3]+1): A[i] -= 1 if any((i < 0 for i in A.values())): print("No") else: print("Yes")