def main():

    S = input()

    if S.replace("eraser", "").replace("erase", "")\

            .replace("dreamer", "").replace("dream", "") == "":

        print("YES")

    else:

        print("NO")





if __name__ == '__main__':

    main()

def main():

    S = input()

    if S.replace("eraser", "").replace("erase", "").replace("dreamer", "").replace("dream", ""):

        return print("NO")

    else:

        return print("YES")





if __name__ == '__main__':

    main()

def main():
    S = input()
    if (
        S.replace("eraser", "")
        .replace("erase", "")
        .replace("dreamer", "")
        .replace("dream", "")
        == ""
    ):
        print("YES")
    else:
        print("NO")


if __name__ == "__main__":
    main()

def main():
    S = input()
    if (
        S.replace("eraser", "")
        .replace("erase", "")
        .replace("dreamer", "")
        .replace("dream", "")
    ):
        return print("NO")
    else:
        return print("YES")


if __name__ == "__main__":
    main()

-        == "" -        print("YES") +        return print("NO") -        print("NO") +        return print("YES")