import sys

sys.setrecursionlimit(10 ** 7)
rl = sys.stdin.readline


def solve():
    N, A, B, C, D = map(int, rl().split())
    S = input()
    
    if C < D:
        if S[A - 1:D].find('##') == -1:
            print('Yes')
        else:
            print('No')
    else:
        if S[B - 2:D + 1].find('...') == -1:
            print('No')
        else:
            print('Yes')


if __name__ == '__main__':
    solve() import sys sys sys.setrecursionlimit(10 ** 7) sys.setrecursionlimit sys setrecursionlimit 10 ** 7 10 7 rl = sys.stdin.readline rl sys.stdin.readline sys.stdin sys stdin readline def solve():
    N, A, B, C, D = map(int, rl().split())
    S = input()
    
    if C < D:
        if S[A - 1:D].find('##') == -1:
            print('Yes')
        else:
            print('No')
    else:
        if S[B - 2:D + 1].find('...') == -1:
            print('No')
        else:
            print('Yes') solve N, A, B, C, D = map(int, rl().split()) N map(int, rl().split()) map int rl().split() ().split () rl split A B C D S = input() S input() input if C < D:
        if S[A - 1:D].find('##') == -1:
            print('Yes')
        else:
            print('No')
    else:
        if S[B - 2:D + 1].find('...') == -1:
            print('No')
        else:
            print('Yes') C < D C D if S[A - 1:D].find('##') == -1:
            print('Yes')
        else:
            print('No')
     S[A - 1:D].find('##') == -1 S[A - 1:D].find('##') [A - 1:D].find [A - 1:D] S A - 1:D A - 1 A 1 D find '##' -1 print('Yes') print 'Yes' print('No') print 'No' if S[B - 2:D + 1].find('...') == -1:
            print('No')
        else:
            print('Yes') S[B - 2:D + 1].find('...') == -1 S[B - 2:D + 1].find('...') [B - 2:D + 1].find [B - 2:D + 1] S B - 2:D + 1 B - 2 B 2 D + 1 D 1 find '...' -1 print('No') print 'No' print('Yes') print 'Yes' if __name__ == '__main__':
    solve() __name__ == '__main__' __name__ '__main__' solve() solve def solve():
    N, A, B, C, D = map(int, rl().split())
    S = input()
    
    if C < D:
        if S[A - 1:D].find('##') == -1:
            print('Yes')
        else:
            print('No')
    else:
        if S[B - 2:D + 1].find('...') == -1:
            print('No')
        else:
            print('Yes') def solve():
    N, A, B, C, D = map(int, rl().split())
    S = input()
    
    if C < D:
        if S[A - 1:D].find('##') == -1:
            print('Yes')
        else:
            print('No')
    else:
        if S[B - 2:D + 1].find('...') == -1:
            print('No')
        else:
            print('Yes') solve rl = sys.stdin.readline sys.stdin.readline rl
import sys

sys.setrecursionlimit(10 ** 7)
rl = sys.stdin.readline


def solve():
    N, A, B, C, D = map(int, rl().split())
    S = input()
    
    if C < D:
        if S[A - 1:D].find('##') == -1:
            print('Yes')
        else:
            print('No')
    else:
        if S[B - 2:D + 1].find('...') == -1:
            print('No')
        else:
            print('Yes')


if __name__ == '__main__':
    solve()
