@staticmethod
def c():
    t = int(sys.stdin.readline().rstrip())
    n = int(sys.stdin.readline().rstrip())
    a = [int(x) for x in sys.stdin.readline().split()]
    m = int(sys.stdin.readline().rstrip())
    b = [int(x) for x in sys.stdin.readline().split()]
    i = 0
    for p in b:
        if (i == n):
            print('no')
            return
        while ((p - a[i]) > t):
            i += 1
            if (i == n):
                print('no')
                return
        if (a[i] > p):
            print('no')
            return
        i += 1
    print('yes')
@staticmethod
def c():
    t = int(sys.stdin.readline().rstrip())
    n = int(sys.stdin.readline().rstrip())
    a = [int(x) for x in sys.stdin.readline().split()]
    m = int(sys.stdin.readline().rstrip())
    b = [int(x) for x in sys.stdin.readline().split()]
    i = 0
    for p in b:
        if (i == n):
            print('no')
            return
        while ((p - a[i]) > t):
            i += 1
            if (i == n):
                print('no')
                return
        if (a[i] > p):
            print('no')
            return
        i += 1
    print('yes')