@staticmethod
def b():
    (n, a, b, k, *p) = map(int, sys.stdin.read().split())
    print(('YES' if (len((set(p) | set([a, b]))) == (k + 2)) else 'NO'))
@staticmethod
def b():
    (n, a, b, k, *p) = map(int, sys.stdin.read().split())
    print(('YES' if (len((set(p) | set([a, b]))) == (k + 2)) else 'NO'))