import Data.Maybe
import Control.Monad
import qualified Data.ByteString.Char8 as C

readInt' = fst.fromJust.C.readInt
readLnInt = map readInt'.C.words<$>C.getLine

x ? (a,b) = if x then a else b

main = do
 [n,a,b,c,d] <- readLnInt
 s <- getLine
 putStr (solve a b c d s)

solve a b c d s = (c>d)?((judge2 waybd)?(answer,"No"),answer) where
  answer = (judge wayac && judge waybd)?("Yes","No")
  wayac = way a c s
  waybd = way b d s

way x y s = drop x (take y s)

judge [] = True
judge [p] = True
judge (p:q:r) = ([p,q]=="##")?(False,True) && (null r)?(True,judge r)

judge2 [] = False
judge2 [p,q] = False
judge2 (p:q:r:s) = ([p,q,r] == "...")?(True,False) || (null s)?(False,judge2 (q:r:s))
