Buggy python submission (verdict: Runtime Error):
strings = ["dream","dreamer","erase","eraser"]

def isDaydream(s):
    if s == "":
        return True
    for string in strings:
        if s.endswith(string):
            if(isDaydream(s[:len(string)*-1])):
                return True
    return False
if(isDaydream(input())):
    print("YES")
else:
    print("NO")

Fixed submission:
def isDaydream(s):
    while s != "":
        if s.endswith("dream"):
            s = s[:-5]
        elif s.endswith("dreamer"):
            s = s[:-7]
        elif s.endswith("erase"):
            s = s[:-5]
        elif s.endswith("eraser"):
            s = s[:-6]
        else :
            return False
    return True

if(isDaydream(input())):
    print("YES")
else:
    print("NO")

Buggy python submission (verdict: Runtime Error):
strings = ["dream","dreamer","erase","eraser"]

def isDaydream(startindex):
    if S[startindex:] == "":
        return True
    for string in strings:
        if S[startindex:].startswith(string):
            if(isDaydream(len(string)+startindex)):
                return True
    return False
S = input()
if(isDaydream(0)):
    print("YES")
else:
    print("NO")

Fixed submission:
def isDaydream(s):
    while s != "":
        if s.endswith("dream"):
            s = s[:-5]
        elif s.endswith("dreamer"):
            s = s[:-7]
        elif s.endswith("erase"):
            s = s[:-5]
        elif s.endswith("eraser"):
            s = s[:-6]
        else :
            return False
    return True

if(isDaydream(input())):
    print("YES")
else:
    print("NO")

Buggy python submission (verdict: Runtime Error):
strings = ["dream","dreamer","erase","eraser"]

def isDaydream(startindex):
    global S
    if S[startindex:] == "":
        return True
    for string in strings:
        if S[startindex:].startswith(string):
            if(isDaydream(len(string)+startindex)):
                return True
    return False
S = input()
if(isDaydream(0)):
    print("YES")
else:
    print("NO")

Fixed submission:
def isDaydream(s):
    while s != "":
        if s.endswith("dream"):
            s = s[:-5]
        elif s.endswith("dreamer"):
            s = s[:-7]
        elif s.endswith("erase"):
            s = s[:-5]
        elif s.endswith("eraser"):
            s = s[:-6]
        else :
            return False
    return True

if(isDaydream(input())):
    print("YES")
else:
    print("NO")

Buggy python submission (verdict: Runtime Error):
strings = ["dream","dreamer","erase","eraser"]

def isDaydream(s):
    if s == "":
        return True
    for string in strings:
        if s.startswith(string):
            if(isDaydream(s[len(string):])):
                return True
    return False
if(isDaydream(input())):
    print("YES")
else:
    print("NO")

Fixed submission:
def isDaydream(s):
    while s != "":
        if s.endswith("dream"):
            s = s[:-5]
        elif s.endswith("dreamer"):
            s = s[:-7]
        elif s.endswith("erase"):
            s = s[:-5]
        elif s.endswith("eraser"):
            s = s[:-6]
        else :
            return False
    return True

if(isDaydream(input())):
    print("YES")
else:
    print("NO")