Buggy python submission (verdict: Runtime Error):
n,a,b,c,d = ( int(i) for i in input().split())
s = input()

a_to_c = s[a:(c-1)-1]
b_to_d = s[b-1:d-1]

possibility = True

if c>d:
    b_to_d = s[(b-1)-1:(d-1)+1]
    if "##" in a_to_c or "..." not in b_to_d
        possibility = False
else:
    b_to_d = s[(b-1)+1:(d-1)-1]
    if "##" in a_to_c or "##" in b_to_d:
        possibility = False

if possibility:
    print("Yes")
else:
    print("No")

Fixed submission:
n,a,b,c,d = ( int(i) for i in input().split())
s = input()

a_to_c = s[(a-1)+1:(c-1)-1 +1]

possibility = True

if c>d:
    b_to_d = s[(b-1)-1:(d-1)+1 +1]
    if "##" in a_to_c or "..." not in b_to_d:
        possibility = False
else:
    b_to_d = s[(b-1)+1:(d-1)-1 +1]
    if "##" in a_to_c or "##" in b_to_d:
        possibility = False

if possibility:
    print("Yes")
else:
    print("No")

Buggy python submission (verdict: Runtime Error):
n,a,b,c,d = ( int(i) for i in input().split())
s = input()

a_to_c = s[a-1:c-1]
b_to_d = s[b-1:d-1]
if (b-1)-1 >= 0:
    b_to_d2 = s[b-1-1:d-1]
else:
    b_to_d2 = s[b-1:d-1]

possibility = True

if a_to_c.find("##")!=-1 or b_to_d.find("##")!=-1:
    possibility = False
if c>d:
    if s[d-1]='#':
        if not(s[b-3:d-1].find("...")!=-1):
            possibility = False
    if not(b_to_d2.find('...')!=-1):
        possibility = False


if possibility:
    print("Yes")
else:
    print("No")
    

Fixed submission:
n,a,b,c,d = ( int(i) for i in input().split())
s = input()

a_to_c = s[(a-1)+1:(c-1)-1 +1]

possibility = True

if c>d:
    b_to_d = s[(b-1)-1:(d-1)+1 +1]
    if "##" in a_to_c or "..." not in b_to_d:
        possibility = False
else:
    b_to_d = s[(b-1)+1:(d-1)-1 +1]
    if "##" in a_to_c or "##" in b_to_d:
        possibility = False

if possibility:
    print("Yes")
else:
    print("No")

Buggy python submission (verdict: Runtime Error):
n,a,b,c,d = ( int(i) for i in input().split())
s = input()

a_to_c = s[a-1:c-1]
b_to_d = s[b-1:d-1]
if (b-1)-2 >= 0:
    b_to_d2 = s[b-1-2:d-1]
elif:
    b_to_d2 = s[b-1:d-1]

possibility = True

if a_to_c.find("##")!=-1 or b_to_d.find("##")!=-1:
    possibility = False
if c>d:
    if not(b_to_d2.find('...')!=-1):
        possibility = False

if possibility:
    print("Yes")
else:
    print("No")
    

Fixed submission:
n,a,b,c,d = ( int(i) for i in input().split())
s = input()

a_to_c = s[(a-1)+1:(c-1)-1 +1]

possibility = True

if c>d:
    b_to_d = s[(b-1)-1:(d-1)+1 +1]
    if "##" in a_to_c or "..." not in b_to_d:
        possibility = False
else:
    b_to_d = s[(b-1)+1:(d-1)-1 +1]
    if "##" in a_to_c or "##" in b_to_d:
        possibility = False

if possibility:
    print("Yes")
else:
    print("No")

Buggy python submission (verdict: Runtime Error):
n,a,b,c,d = ( int(i) for i in input().split())
s = input()

a_to_c = s[a-1:c-1]
b_to_d = s[b-1:d-1]
if (b-1)-2 < 0:
    b_to_d2 = s[b-1:d-1]
elif:
    b_to_d2 = s[b-1-2:d-1]

possibility = True

if a_to_c.find("##")!=-1 or b_to_d.find("##")!=-1:
    possibility = False
if c>d:
    if not(b_to_d2.find('...')!=-1):
        possibility = False

if possibility:
    print("Yes")
else:
    print("No")
    

Fixed submission:
n,a,b,c,d = ( int(i) for i in input().split())
s = input()

a_to_c = s[(a-1)+1:(c-1)-1 +1]

possibility = True

if c>d:
    b_to_d = s[(b-1)-1:(d-1)+1 +1]
    if "##" in a_to_c or "..." not in b_to_d:
        possibility = False
else:
    b_to_d = s[(b-1)+1:(d-1)-1 +1]
    if "##" in a_to_c or "##" in b_to_d:
        possibility = False

if possibility:
    print("Yes")
else:
    print("No")