import sys
from collections import defaultdict
readline = sys.stdin.buffer.readline
#sys.setrecursionlimit(10**8)


def geta(fn=lambda s: s.decode()):
    return map(fn, readline().split())


def gete(fn=lambda s: s.decode()):
    return fn(readline().rstrip())


def main():
    n, a, b, c, d = geta(int)
    s = "#" + gete()

    if c < d:
        # no consecutive rocks between [a,c] and [b,d]
        if "##" in s[a:c + 1] or "##" in s[b:d + 1]:
            print("No")
        else:
            print("Yes")
    else:
        # no consecutive rocks between [a,c] and,
        # [b-1,d+1] contains "..."

        if (not "##" in s[a:c + 1]) and "..." in s[b - 1:d + 2]:
            print("Yes")
        else:
            print("No")


if __name__ == "__main__":
    main() import sys sys from collections import defaultdict readline = sys.stdin.buffer.readline readline sys.stdin.buffer.readline sys.stdin.buffer sys.stdin sys stdin buffer readline def geta(fn=lambda s: s.decode()):
    return map(fn, readline().split()) geta return map(fn, readline().split()) map(fn, readline().split()) map fn readline().split() ().split () readline split fn=lambda s: s.decode() fn lambda s: s.decode() s.decode() s.decode s decode s def gete(fn=lambda s: s.decode()):
    return fn(readline().rstrip()) gete return fn(readline().rstrip()) fn(readline().rstrip()) fn readline().rstrip() ().rstrip () readline rstrip fn=lambda s: s.decode() fn lambda s: s.decode() s.decode() s.decode s decode s def main():
    n, a, b, c, d = geta(int)
    s = "#" + gete()

    if c < d:
        # no consecutive rocks between [a,c] and [b,d]
        if "##" in s[a:c + 1] or "##" in s[b:d + 1]:
            print("No")
        else:
            print("Yes")
    else:
        # no consecutive rocks between [a,c] and,
        # [b-1,d+1] contains "..."

        if (not "##" in s[a:c + 1]) and "..." in s[b - 1:d + 2]:
            print("Yes")
        else:
            print("No") main n, a, b, c, d = geta(int) n geta(int) geta int a b c d s = "#" + gete() s "#" + gete() "#" gete() gete if c < d:
        # no consecutive rocks between [a,c] and [b,d]
        if "##" in s[a:c + 1] or "##" in s[b:d + 1]:
            print("No")
        else:
            print("Yes")
    else:
        # no consecutive rocks between [a,c] and,
        # [b-1,d+1] contains "..."

        if (not "##" in s[a:c + 1]) and "..." in s[b - 1:d + 2]:
            print("Yes")
        else:
            print("No") c < d c d if "##" in s[a:c + 1] or "##" in s[b:d + 1]:
            print("No")
        else:
            print("Yes")
     "##" in s[a:c + 1] or "##" in s[b:d + 1] "##" in s[a:c + 1] "##" s[a:c + 1] s a:c + 1 a c + 1 c 1 "##" in s[b:d + 1] "##" s[b:d + 1] s b:d + 1 b d + 1 d 1 print("No") print "No" print("Yes") print "Yes" if (not "##" in s[a:c + 1]) and "..." in s[b - 1:d + 2]:
            print("Yes")
        else:
            print("No") (not "##" in s[a:c + 1]) and "..." in s[b - 1:d + 2] not "##" in s[a:c + 1] "##" in s[a:c + 1] "##" s[a:c + 1] s a:c + 1 a c + 1 c 1 "..." in s[b - 1:d + 2] "..." s[b - 1:d + 2] s b - 1:d + 2 b - 1 b 1 d + 2 d 2 print("Yes") print "Yes" print("No") print "No" if __name__ == "__main__":
    main() __name__ == "__main__" __name__ "__main__" main() main def gete(fn=lambda s: s.decode()):
    return fn(readline().rstrip()) def gete(fn=lambda s: s.decode()):
    return fn(readline().rstrip()) gete def main():
    n, a, b, c, d = geta(int)
    s = "#" + gete()

    if c < d:
        # no consecutive rocks between [a,c] and [b,d]
        if "##" in s[a:c + 1] or "##" in s[b:d + 1]:
            print("No")
        else:
            print("Yes")
    else:
        # no consecutive rocks between [a,c] and,
        # [b-1,d+1] contains "..."

        if (not "##" in s[a:c + 1]) and "..." in s[b - 1:d + 2]:
            print("Yes")
        else:
            print("No") def main():
    n, a, b, c, d = geta(int)
    s = "#" + gete()

    if c < d:
        # no consecutive rocks between [a,c] and [b,d]
        if "##" in s[a:c + 1] or "##" in s[b:d + 1]:
            print("No")
        else:
            print("Yes")
    else:
        # no consecutive rocks between [a,c] and,
        # [b-1,d+1] contains "..."

        if (not "##" in s[a:c + 1]) and "..." in s[b - 1:d + 2]:
            print("Yes")
        else:
            print("No") main def geta(fn=lambda s: s.decode()):
    return map(fn, readline().split()) def geta(fn=lambda s: s.decode()):
    return map(fn, readline().split()) geta readline = sys.stdin.buffer.readline sys.stdin.buffer.readline readline
import sys
from collections import defaultdict
readline = sys.stdin.buffer.readline
#sys.setrecursionlimit(10**8)


def geta(fn=lambda s: s.decode()):
    return map(fn, readline().split())


def gete(fn=lambda s: s.decode()):
    return fn(readline().rstrip())


def main():
    n, a, b, c, d = geta(int)
    s = "#" + gete()

    if c < d:
        # no consecutive rocks between [a,c] and [b,d]
        if "##" in s[a:c + 1] or "##" in s[b:d + 1]:
            print("No")
        else:
            print("Yes")
    else:
        # no consecutive rocks between [a,c] and,
        # [b-1,d+1] contains "..."

        if (not "##" in s[a:c + 1]) and "..." in s[b - 1:d + 2]:
            print("Yes")
        else:
            print("No")


if __name__ == "__main__":
    main()