from copy import deepcopy
def solve():
    N,A,B,C,D = map(lambda x:int(x)-1, input().split())
    field_orig = list(input())
    field = deepcopy(field_orig)

    if C < D:
        if existsContinuousRocks(field,A,B,C,D):
            print('No')
        else:
            print('Yes')
    else:
        if not existsContinuousRocks(field,A,B,C,D) \
            and existsContinuousDots(field,A,B,C,D):
            print('Yes')
        else:
            print('No')

def existsContinuousRocks(field, A, B, C, D):
    for i in range(A, min(max(C,D), len(field)-1)):
        if field[i] == '#' and field[i+1] == '#':
            return True
    return False

def existsContinuousDots(field,A,B,C,D):
    for i in range(B-1,min(D, len(field)-2)):
        if field[i] == '.' and field[i+1] == '.' and field[i+2] == '.':
            return True
    return False


if __name__ == '__main__':
    solve() from copy import deepcopy def solve():
    N,A,B,C,D = map(lambda x:int(x)-1, input().split())
    field_orig = list(input())
    field = deepcopy(field_orig)

    if C < D:
        if existsContinuousRocks(field,A,B,C,D):
            print('No')
        else:
            print('Yes')
    else:
        if not existsContinuousRocks(field,A,B,C,D) \
            and existsContinuousDots(field,A,B,C,D):
            print('Yes')
        else:
            print('No') solve N,A,B,C,D = map(lambda x:int(x)-1, input().split()) N map(lambda x:int(x)-1, input().split()) map lambda x:int(x)-1 int(x)-1 int(x) int x 1 x input().split() ().split () input split A B C D field_orig = list(input()) field_orig list(input()) list input() input field = deepcopy(field_orig) field deepcopy(field_orig) deepcopy field_orig if C < D:
        if existsContinuousRocks(field,A,B,C,D):
            print('No')
        else:
            print('Yes')
    else:
        if not existsContinuousRocks(field,A,B,C,D) \
            and existsContinuousDots(field,A,B,C,D):
            print('Yes')
        else:
            print('No') C < D C D if existsContinuousRocks(field,A,B,C,D):
            print('No')
        else:
            print('Yes')
     existsContinuousRocks(field,A,B,C,D) existsContinuousRocks field A B C D print('No') print 'No' print('Yes') print 'Yes' if not existsContinuousRocks(field,A,B,C,D) \
            and existsContinuousDots(field,A,B,C,D):
            print('Yes')
        else:
            print('No') not existsContinuousRocks(field,A,B,C,D) \
            and existsContinuousDots(field,A,B,C,D) not existsContinuousRocks(field,A,B,C,D) existsContinuousRocks(field,A,B,C,D) existsContinuousRocks field A B C D existsContinuousDots(field,A,B,C,D) existsContinuousDots field A B C D print('Yes') print 'Yes' print('No') print 'No' def existsContinuousRocks(field, A, B, C, D):
    for i in range(A, min(max(C,D), len(field)-1)):
        if field[i] == '#' and field[i+1] == '#':
            return True
    return False existsContinuousRocks for i in range(A, min(max(C,D), len(field)-1)):
        if field[i] == '#' and field[i+1] == '#':
            return True
     i range(A, min(max(C,D), len(field)-1)) range A min(max(C,D), len(field)-1) min max(C,D) max C D len(field)-1 len(field) len field 1 if field[i] == '#' and field[i+1] == '#':
            return True
     field[i] == '#' and field[i+1] == '#' field[i] == '#' field[i] field i '#' field[i+1] == '#' field[i+1] field i+1 i 1 '#' return True True return False False field field A A B B C C D D def existsContinuousDots(field,A,B,C,D):
    for i in range(B-1,min(D, len(field)-2)):
        if field[i] == '.' and field[i+1] == '.' and field[i+2] == '.':
            return True
    return False existsContinuousDots for i in range(B-1,min(D, len(field)-2)):
        if field[i] == '.' and field[i+1] == '.' and field[i+2] == '.':
            return True
     i range(B-1,min(D, len(field)-2)) range B-1 B 1 min(D, len(field)-2) min D len(field)-2 len(field) len field 2 if field[i] == '.' and field[i+1] == '.' and field[i+2] == '.':
            return True
     field[i] == '.' and field[i+1] == '.' and field[i+2] == '.' field[i] == '.' and field[i+1] == '.' field[i] == '.' field[i] field i '.' field[i+1] == '.' field[i+1] field i+1 i 1 '.' field[i+2] == '.' field[i+2] field i+2 i 2 '.' return True True return False False field field A A B B C C D D if __name__ == '__main__':
    solve() __name__ == '__main__' __name__ '__main__' solve() solve def solve():
    N,A,B,C,D = map(lambda x:int(x)-1, input().split())
    field_orig = list(input())
    field = deepcopy(field_orig)

    if C < D:
        if existsContinuousRocks(field,A,B,C,D):
            print('No')
        else:
            print('Yes')
    else:
        if not existsContinuousRocks(field,A,B,C,D) \
            and existsContinuousDots(field,A,B,C,D):
            print('Yes')
        else:
            print('No') def solve():
    N,A,B,C,D = map(lambda x:int(x)-1, input().split())
    field_orig = list(input())
    field = deepcopy(field_orig)

    if C < D:
        if existsContinuousRocks(field,A,B,C,D):
            print('No')
        else:
            print('Yes')
    else:
        if not existsContinuousRocks(field,A,B,C,D) \
            and existsContinuousDots(field,A,B,C,D):
            print('Yes')
        else:
            print('No') solve def existsContinuousRocks(field, A, B, C, D):
    for i in range(A, min(max(C,D), len(field)-1)):
        if field[i] == '#' and field[i+1] == '#':
            return True
    return False def existsContinuousRocks(field, A, B, C, D):
    for i in range(A, min(max(C,D), len(field)-1)):
        if field[i] == '#' and field[i+1] == '#':
            return True
    return False existsContinuousRocks def existsContinuousDots(field,A,B,C,D):
    for i in range(B-1,min(D, len(field)-2)):
        if field[i] == '.' and field[i+1] == '.' and field[i+2] == '.':
            return True
    return False def existsContinuousDots(field,A,B,C,D):
    for i in range(B-1,min(D, len(field)-2)):
        if field[i] == '.' and field[i+1] == '.' and field[i+2] == '.':
            return True
    return False existsContinuousDots
from copy import deepcopy
def solve():
    N,A,B,C,D = map(lambda x:int(x)-1, input().split())
    field_orig = list(input())
    field = deepcopy(field_orig)

    if C < D:
        if existsContinuousRocks(field,A,B,C,D):
            print('No')
        else:
            print('Yes')
    else:
        if not existsContinuousRocks(field,A,B,C,D) \
            and existsContinuousDots(field,A,B,C,D):
            print('Yes')
        else:
            print('No')

def existsContinuousRocks(field, A, B, C, D):
    for i in range(A, min(max(C,D), len(field)-1)):
        if field[i] == '#' and field[i+1] == '#':
            return True
    return False

def existsContinuousDots(field,A,B,C,D):
    for i in range(B-1,min(D, len(field)-2)):
        if field[i] == '.' and field[i+1] == '.' and field[i+2] == '.':
            return True
    return False


if __name__ == '__main__':
    solve()