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"
turn = b
impossible = 0

loop do
  if impossible == 2 then
    break
  end

  if s[a+1] == "." || s[a+2] == "." || b == d then
    turn = a
  else
    turn = b
  end

  if turn == n-1 then
    impossible += 1
  else
    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
    else
      impossible += 1
    end
    if tmp == b then
      b, turn = turn, a
    else
      a, turn  = turn, b
    end
  end
end

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