using System;
using System.Collections.Generic;
using System.Linq;
using BitArray = System.Collections.BitArray;
using BigInteger = System.Numerics.BigInteger;

namespace AtCoderProject
{
    public class Program
    {
        public object Calc()
        {
            var line = consoleReader.Split.Int;
            var N = line[0];
            var A = line[1] - 1;
            var B = line[2] - 1;
            var C = line[3] - 1;
            var D = line[4] - 1;
            var s = consoleReader.String.Select(c => c == '.').ToArray();

            var renzokuStone = new List<int>();
            var sanrenzoku = new List<int>();
            for (int i = 1; i < N; i++)
            {
                if (!s[i - 1] && !s[i]) renzokuStone.Add(i - 1);
                if (i >= 2 && s[i - 2] && s[i - 1] && s[i]) sanrenzoku.Add(i - 2);
            }

            foreach (var index in renzokuStone)
            {
                if ((A < index && index < C) || (B < index && index < D)) return "No";
            }

            if ((A < B && C < D) || (A > B && C > D)) return "Yes";


            var rangeS = Math.Max(A, B) - 1;
            var rangeE = Math.Min(C, D) - 1;
            foreach (var index in sanrenzoku)
            {
                if (rangeS <= index && index <= rangeE) return "Yes";
            }

            return "No";
        }

        #region いつもの
        private readonly ConsoleReader consoleReader;
        public Program(ConsoleReader consoleReader) { this.consoleReader = consoleReader; }
        static void Main() => Console.WriteLine(new Program(new ConsoleReader()).Calc()); static string AllLines<T>(IEnumerable<T> source) => string.Join("\n", source);
        #endregion
    }

#pragma warning disable
    public class ConsoleReader { public class SplitLine { string[] splited; public SplitLine(string line) { splited = line.Split(); } public string[] String => splited.ToArray(); public int[] Int => splited.Select(int.Parse).ToArray(); public long[] Long => splited.Select(long.Parse).ToArray(); public ulong[] ULong => splited.Select(ulong.Parse).ToArray(); public double[] Double => splited.Select(double.Parse).ToArray(); } public class RepeatLine { ConsoleReader reader; int num; public RepeatLine(ConsoleReader reader, int num) { this.reader = reader; this.num = num; } public IEnumerable<string> String { get { for (int i = 0; i < num; i++) yield return reader.String; } } public IEnumerable<int> Int { get { for (int i = 0; i < num; i++) yield return reader.Int; } } public IEnumerable<long> Long { get { for (int i = 0; i < num; i++) yield return reader.Long; } } public IEnumerable<string[]> Split { get { for (int i = 0; i < num; i++) yield return reader.Split.String; } } public IEnumerable<int[]> SplitInt { get { for (int i = 0; i < num; i++) yield return reader.Split.Int; } } } public virtual string String => Console.ReadLine(); public int Int => int.Parse(String); public long Long => long.Parse(String); public ulong ULong => ulong.Parse(String); public double Double => double.Parse(String); public SplitLine Split => new SplitLine(String); public RepeatLine Repeat(int count) => new RepeatLine(this, count); }
}

Measured memory_bytes: 14688