n, a, b, c, d = gets.split.map(&:to_i)
ary = gets.chomp.chars

needChange = false

if a > b && c < d || a < b && c > d
  needChange = true
  for i in [a, b].max - 2 .. [c, d].min - 2
    if [ary[i], ary[i + 1], ary[i + 2]] == ['.', '.', '.']
      needChange = false
    end
  end
end

if needChange == true
  puts :No
  exit
end

for i in [a, b].min - 1 .. [c, d].max - 1
  if [ary[i], ary[i + 1]] == ['#', '#']
    if a < i && i < c || b < i && i < d
      puts :No
      exit
    end
  end
end

puts :Yes
