def main():

    H = list(map(int, open(0).read().split()[:1:-1]))

    pre = None

    for h in H:

        if pre is None:

            pre = h

        if pre + 1 < h:

            print("No")

            return

        if pre + 1 == h:

            pre = h - 1

        else:

            pre = h



    print("Yes")

    return





main()

def main():

    H = list(map(int, open(0).read().split()[:1:-1]))

    pre = None

    for h in H:

        if pre is None:

            pre = h

        elif h <= pre:

            pre = h

        elif pre + 1 == h:

            continue

        else:

            # pre + 1 < h

            print("No")

            return



    print("Yes")

    return





main()

def main():
    H = list(map(int, open(0).read().split()[:1:-1]))
    pre = None
    for h in H:
        if pre is None:
            pre = h
        if pre + 1 < h:
            print("No")
            return
        if pre + 1 == h:
            pre = h - 1
        else:
            pre = h
    print("Yes")
    return


main()

def main():
    H = list(map(int, open(0).read().split()[:1:-1]))
    pre = None
    for h in H:
        if pre is None:
            pre = h
        elif h <= pre:
            pre = h
        elif pre + 1 == h:
            continue
        else:
            # pre + 1 < h
            print("No")
            return
    print("Yes")
    return


main()

-        if pre + 1 < h: +        elif h <= pre: +            pre = h +        elif pre + 1 == h: +            continue +        else: +            # pre + 1 < h -        if pre + 1 == h: -            pre = h - 1 -        else: -            pre = h