n, a, b, c, d = gets.split.map(&:to_i)
row = gets.chars
min_start = [a, b].min
max_start = [a, b].max
min_end = [c, d].min
max_end = [c, d].max
ans = "Yes"

(min_start..max_end-1).each do |i|
  if row[i-1] == "#" && row[i] == "#"
    ans = "No"
  end
end

if d < c
  flg = false
  (max_start..min_end).each do |i|
    if row[i-1] == "." && row[i] == "." && row[i+1] == "."
      flg = true
    end
  end
  ans = "No" if !flg
end

puts ans
