n, a, b, c, d = gets.chomp.split(" ")
s = gets.chomp.split("")
a,b,c,d = a.to_i, b.to_i, c.to_i, d.to_i

s[a-1] = "A"
s[b-1] = "B"

def forward(s, tag="A", aim)
  locate = s.index(tag)
  flag = "can"
  if s[locate+1] == "."
    s[locate+1] = tag
    s[locate] = "."
  elsif s[locate+2] == "."
    s[locate+2] = tag
    s[locate] = "."
  else
    flag = "cant"
  end
  if s.index(tag) == (aim-1)
    flag = "reached"
  end
#  p s
  return flag
end

if c > d
  fir = ["A", c]
  sec = ["B", d]
else
  fir = ["B", d]
  sec = ["A", c]
end

flag = "can"
while s.index(fir[0]) < (fir[1]-1) && flag == "can"
  while flag == "can"
    flag = forward(s, fir[0], fir[1])
  end
  flag = forward(s, sec[0], sec[1])
end
flag = "can"
while flag == "can"
    flag = forward(s, sec[0], sec[1])
end

if s.index("A") >= (c-1) && s.index("B") >= (d-1)
 p "Yes"
else
 p "No"
end