n, a, b, c, d = gets.chomp.split(" ").map(&:to_i)
s = gets.chomp.split("")
a, b, c, d = a-1, b-1, c-1, d-1

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

priority = c - d

loop do
  #p s
  if a == c && b == d then
    break
  end

  if priority > 0 && (s[a+1] == "." || s[a+2] == ".") then
    turn = a
  elsif s[b+1] == "." || s[b+2] == "." then
    turn = b
  else
    break
  end

  tmp  = turn
  if s[turn+1] == "." then
    s[turn], s[turn + 1] = s[turn + 1], s[turn] 
    turn = turn + 1
  elsif s[turn+2] == "." then
    s[turn], s[turn + 2] = s[turn + 2], s[turn] 
    turn = turn + 2
  end
  if tmp == b then
    b = turn
  else
    a  = turn
  end
end

if a == c && b == d  then
  puts("Yes")
else
  puts("No")
end