def main():
    n, a, b, c, d = list(map(lambda x: int(x) - 1, input().split()))
    n += 1
    s = list(input())
    s = s[a:max(c, d) + 1]
    for i in range(len(s) - 1):
        if s[i] == '#' and s[i + 1] == '#':
            print('No')
            exit()
    if c < d:
        print('Yes')
    else:
        ch = False
        for i in range(b, d + 1):
            if s[i - 1] == s[i] == s[i + 1] == '.':
                ch = True
        if ch:
            print('Yes')
        else:
            print('No')

if __name__ == '__main__':
    main() def main():
    n, a, b, c, d = list(map(lambda x: int(x) - 1, input().split()))
    n += 1
    s = list(input())
    s = s[a:max(c, d) + 1]
    for i in range(len(s) - 1):
        if s[i] == '#' and s[i + 1] == '#':
            print('No')
            exit()
    if c < d:
        print('Yes')
    else:
        ch = False
        for i in range(b, d + 1):
            if s[i - 1] == s[i] == s[i + 1] == '.':
                ch = True
        if ch:
            print('Yes')
        else:
            print('No') main n, a, b, c, d = list(map(lambda x: int(x) - 1, input().split())) n list(map(lambda x: int(x) - 1, input().split())) list 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 n += 1 n 1 s = list(input()) s list(input()) list input() input s = s[a:max(c, d) + 1] s s[a:max(c, d) + 1] s a:max(c, d) + 1 a max(c, d) + 1 max(c, d) max c d 1 for i in range(len(s) - 1):
        if s[i] == '#' and s[i + 1] == '#':
            print('No')
            exit()
     i range(len(s) - 1) range len(s) - 1 len(s) len s 1 if s[i] == '#' and s[i + 1] == '#':
            print('No')
            exit()
     s[i] == '#' and s[i + 1] == '#' s[i] == '#' s[i] s i '#' s[i + 1] == '#' s[i + 1] s i + 1 i 1 '#' print('No') print 'No' exit() exit if c < d:
        print('Yes')
    else:
        ch = False
        for i in range(b, d + 1):
            if s[i - 1] == s[i] == s[i + 1] == '.':
                ch = True
        if ch:
            print('Yes')
        else:
            print('No') c < d c d print('Yes') print 'Yes' ch = False ch False for i in range(b, d + 1):
            if s[i - 1] == s[i] == s[i + 1] == '.':
                ch = True
         i range(b, d + 1) range b d + 1 d 1 if s[i - 1] == s[i] == s[i + 1] == '.':
                ch = True
         s[i - 1] == s[i] == s[i + 1] == '.' s[i - 1] == s[i] == s[i + 1] s[i - 1] == s[i] s[i - 1] s i - 1 i 1 s[i] s i s[i + 1] s i + 1 i 1 '.' ch = True ch True if ch:
            print('Yes')
        else:
            print('No') ch print('Yes') print 'Yes' print('No') print 'No' if __name__ == '__main__':
    main() __name__ == '__main__' __name__ '__main__' main() main def main():
    n, a, b, c, d = list(map(lambda x: int(x) - 1, input().split()))
    n += 1
    s = list(input())
    s = s[a:max(c, d) + 1]
    for i in range(len(s) - 1):
        if s[i] == '#' and s[i + 1] == '#':
            print('No')
            exit()
    if c < d:
        print('Yes')
    else:
        ch = False
        for i in range(b, d + 1):
            if s[i - 1] == s[i] == s[i + 1] == '.':
                ch = True
        if ch:
            print('Yes')
        else:
            print('No') def main():
    n, a, b, c, d = list(map(lambda x: int(x) - 1, input().split()))
    n += 1
    s = list(input())
    s = s[a:max(c, d) + 1]
    for i in range(len(s) - 1):
        if s[i] == '#' and s[i + 1] == '#':
            print('No')
            exit()
    if c < d:
        print('Yes')
    else:
        ch = False
        for i in range(b, d + 1):
            if s[i - 1] == s[i] == s[i + 1] == '.':
                ch = True
        if ch:
            print('Yes')
        else:
            print('No') main
def main():
    n, a, b, c, d = list(map(lambda x: int(x) - 1, input().split()))
    n += 1
    s = list(input())
    s = s[a:max(c, d) + 1]
    for i in range(len(s) - 1):
        if s[i] == '#' and s[i + 1] == '#':
            print('No')
            exit()
    if c < d:
        print('Yes')
    else:
        ch = False
        for i in range(b, d + 1):
            if s[i - 1] == s[i] == s[i + 1] == '.':
                ch = True
        if ch:
            print('Yes')
        else:
            print('No')

if __name__ == '__main__':
    main()
