--{-# LANGUAGE OverloadedStrings #-}
--{-# LANGUAGE OverloadedLists   #-}
{-# LANGUAGE BangPatterns      #-} --引数に!
{-# LANGUAGE MultiWayIf        #-}
{-# LANGUAGE TupleSections     #-}

import Data.Bits
import Data.Foldable (foldlM,foldrM)
import Data.Maybe (fromJust)
import Data.List
--import Data.Matrix.Unboxed
import Data.Array  --変数衝突
import Data.Array.Unboxed
import Data.Array.MArray
import Data.Array.ST
import Data.Graph
--import Data.Vector as V　--変数衝突
import qualified Data.Vector.Unboxed as V
import Control.Monad
import Control.Monad.State
import Control.Monad.ST
import qualified Data.ByteString.Lazy.Char8 as B
import Debug.Trace

type Ans = String
type Road = String

--人が入れるかチェック
checkRange1 :: Road  -> Bool
checkRange1 [] = True
checkRange1 [r] = True
checkRange1 (r1:r2:road) = if r1 == '#' && r2 == '#' then False
    else checkRange1 (r2:road)

checkRange2 :: Int -> Int -> Int -> Bool -> Road  -> Bool
checkRange2 b d _ switch [] = switch
checkRange2 b d _ switch [r] = switch
checkRange2 b d cnt switch (r1:r2:r3:road)
  | (b-1) <= cnt && cnt <= (d-1) =
    if r1 == '#' && r2 == '#' then False
      else if r1 == '.' && r2 == '.' && r3 == '.' then checkRange2 b d (cnt+1) True (r2:r3:road)
        else checkRange2 b d (cnt+1) switch (r2:r3:road)
  | otherwise = if r1 == '#' && r2 == '#' then False
      else checkRange2 b d (cnt+1) switch (r2:r3:road)
checkRange2 b d cnt switch (r1:r2:road) = if r1 == '#' && r2 == '#' then False
    else checkRange2 b d (cnt+1) switch (r2:road)

solve :: Int -> Int -> Int -> Int -> Int -> String -> Ans
solve n a b c d road = do
  let pattern1 = if checkRange1 (drop a $ take (d+1) road) then "Yes" else "No"
      pattern2 = if checkRange1 (drop a $ take (c+1) road) && checkRange1 (drop b $ take (d+1) road) then "Yes" else "No"
      pattern3 = if checkRange2 b d 0 False (drop a $ take (c+1) road) then "Yes" else "No"
  if b < c && c < d then pattern1
    else if c < b && b < d then pattern2
      else if b < d && d < c then pattern3
        else error "b c d is invalid"

readBInt :: B.ByteString -> Int
readBInt = fst . fromJust . B.readInt

main0 :: B.ByteString -> Ans
main0 cont =
   let remLines0 = map B.words (B.lines cont)
       [n',a',b',c',d']:remLines1 = remLines0
       n = readBInt n'
       a = readBInt a'
       b = readBInt b'
       c = readBInt c'
       d = readBInt d'
       [s]:remLines2 = remLines1
   in solve n (a-1) (b-1) (c-1) (d-1) (B.unpack s)

main :: IO ()
main = putStrLn . main0 =<< B.getContents
