import sys
n, a, b, c, d = map(int, sys.stdin.readline().split())
s = sys.stdin.readline().rstrip()

def can_reach(start, end):
    for i in range(start, end):
        if s[i] == '#' and s[i+1] == '#':
            return False
    return True

if can_reach(a-1, c-1) and can_reach(b-1, d-1):
    if c < d:
        print('Yes')
    else:
        flag = False
        for i in range(b-1, d):
            if s[i-1] == '.' and s[i] == '.' and s[i+1] == '.':
                flag = True
        print('Yes' if flag else 'No')
else:
    print('No') import sys sys n, a, b, c, d = map(int, sys.stdin.readline().split()) n map(int, sys.stdin.readline().split()) map int sys.stdin.readline().split() sys.stdin.readline().split sys.stdin.readline() sys.stdin.readline sys.stdin sys stdin readline split a b c d s = sys.stdin.readline().rstrip() s sys.stdin.readline().rstrip() sys.stdin.readline().rstrip sys.stdin.readline() sys.stdin.readline sys.stdin sys stdin readline rstrip def can_reach(start, end):
    for i in range(start, end):
        if s[i] == '#' and s[i+1] == '#':
            return False
    return True can_reach for i in range(start, end):
        if s[i] == '#' and s[i+1] == '#':
            return False
     i range(start, end) range start end if s[i] == '#' and s[i+1] == '#':
            return False
     s[i] == '#' and s[i+1] == '#' s[i] == '#' s[i] s i '#' s[i+1] == '#' s[i+1] s i+1 i 1 '#' return False False return True True start start end end if can_reach(a-1, c-1) and can_reach(b-1, d-1):
    if c < d:
        print('Yes')
    else:
        flag = False
        for i in range(b-1, d):
            if s[i-1] == '.' and s[i] == '.' and s[i+1] == '.':
                flag = True
        print('Yes' if flag else 'No')
else:
    print('No') can_reach(a-1, c-1) and can_reach(b-1, d-1) can_reach(a-1, c-1) can_reach a-1 a 1 c-1 c 1 can_reach(b-1, d-1) can_reach b-1 b 1 d-1 d 1 if c < d:
        print('Yes')
    else:
        flag = False
        for i in range(b-1, d):
            if s[i-1] == '.' and s[i] == '.' and s[i+1] == '.':
                flag = True
        print('Yes' if flag else 'No') c < d c d print('Yes') print 'Yes' flag = False flag False for i in range(b-1, d):
            if s[i-1] == '.' and s[i] == '.' and s[i+1] == '.':
                flag = True
         i range(b-1, d) range b-1 b 1 d if s[i-1] == '.' and s[i] == '.' and s[i+1] == '.':
                flag = True
         s[i-1] == '.' and s[i] == '.' and s[i+1] == '.' s[i-1] == '.' and s[i] == '.' s[i-1] == '.' s[i-1] s i-1 i 1 '.' s[i] == '.' s[i] s i '.' s[i+1] == '.' s[i+1] s i+1 i 1 '.' flag = True flag True print('Yes' if flag else 'No') print 'Yes' if flag else 'No' flag 'Yes' 'No' print('No') print 'No' flag = True True flag n, a, b, c, d = map(int, sys.stdin.readline().split()) map(int, sys.stdin.readline().split()) n b, c, d = map(int, sys.stdin.readline().split()) map(int, sys.stdin.readline().split()) b s = sys.stdin.readline().rstrip() sys.stdin.readline().rstrip() s c, d = map(int, sys.stdin.readline().split()) map(int, sys.stdin.readline().split()) c def can_reach(start, end):
    for i in range(start, end):
        if s[i] == '#' and s[i+1] == '#':
            return False
    return True def can_reach(start, end):
    for i in range(start, end):
        if s[i] == '#' and s[i+1] == '#':
            return False
    return True can_reach d = map(int, sys.stdin.readline().split()) map(int, sys.stdin.readline().split()) d a, b, c, d = map(int, sys.stdin.readline().split()) map(int, sys.stdin.readline().split()) a flag = False False flag
import sys
n, a, b, c, d = map(int, sys.stdin.readline().split())
s = sys.stdin.readline().rstrip()

def can_reach(start, end):
    for i in range(start, end):
        if s[i] == '#' and s[i+1] == '#':
            return False
    return True

if can_reach(a-1, c-1) and can_reach(b-1, d-1):
    if c < d:
        print('Yes')
    else:
        flag = False
        for i in range(b-1, d):
            if s[i-1] == '.' and s[i] == '.' and s[i+1] == '.':
                flag = True
        print('Yes' if flag else 'No')
else:
    print('No')
