def main():
    n, a, b, c, d = map(int, input().split())
    s = input()
    r = 'Yes'
    if ('##' in s[a-1:c]) or ('##' in s[b-1:d]):
        r = 'No'
    else:
        if (c>d) and not ('...' in s[b-2:d+1]):
            r = 'No'
    print(r)

main() def main():
    n, a, b, c, d = map(int, input().split())
    s = input()
    r = 'Yes'
    if ('##' in s[a-1:c]) or ('##' in s[b-1:d]):
        r = 'No'
    else:
        if (c>d) and not ('...' in s[b-2:d+1]):
            r = 'No'
    print(r) main n, a, b, c, d = map(int, input().split()) n map(int, input().split()) map int input().split() ().split () input split a b c d s = input() s input() input r = 'Yes' r 'Yes' if ('##' in s[a-1:c]) or ('##' in s[b-1:d]):
        r = 'No'
    else:
        if (c>d) and not ('...' in s[b-2:d+1]):
            r = 'No'
     ('##' in s[a-1:c]) or ('##' in s[b-1:d]) '##' in s[a-1:c] '##' s[a-1:c] s a-1:c a-1 a 1 c '##' in s[b-1:d] '##' s[b-1:d] s b-1:d b-1 b 1 d r = 'No' r 'No' if (c>d) and not ('...' in s[b-2:d+1]):
            r = 'No'
     (c>d) and not ('...' in s[b-2:d+1]) c>d c d not ('...' in s[b-2:d+1]) '...' in s[b-2:d+1] '...' s[b-2:d+1] s b-2:d+1 b-2 b 2 d+1 d 1 r = 'No' r 'No' print(r) print r main() main def main():
    n, a, b, c, d = map(int, input().split())
    s = input()
    r = 'Yes'
    if ('##' in s[a-1:c]) or ('##' in s[b-1:d]):
        r = 'No'
    else:
        if (c>d) and not ('...' in s[b-2:d+1]):
            r = 'No'
    print(r) def main():
    n, a, b, c, d = map(int, input().split())
    s = input()
    r = 'Yes'
    if ('##' in s[a-1:c]) or ('##' in s[b-1:d]):
        r = 'No'
    else:
        if (c>d) and not ('...' in s[b-2:d+1]):
            r = 'No'
    print(r) main
def main():
    n, a, b, c, d = map(int, input().split())
    s = input()
    r = 'Yes'
    if ('##' in s[a-1:c]) or ('##' in s[b-1:d]):
        r = 'No'
    else:
        if (c>d) and not ('...' in s[b-2:d+1]):
            r = 'No'
    print(r)

main()