def main(): import sys input = sys.stdin.read().split() idx = 0 N = int(input[idx]) idx += 1 M = int(input[idx]) idx += 1 A = list(map(int, input[idx:idx+M])) idx += M Q = int(input[idx]) idx += 1 B = list(map(int, input[idx:idx+Q])) pos = A.copy() occupied = set(pos) for b in B: k = b - 1 # convert to 0-based index x = pos[k] right = x + 1 left = x - 1 right_ok = (right <= N) and (right not in occupied) left_ok = (left >= 1) and (left not in occupied) if right_ok: new_pos = right elif left_ok: new_pos = left else: print("NO") return occupied.remove(x) occupied.add(new_pos) pos[k] = new_pos print("YES") if __name__ == "__main__": main()