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

a_road = s[(a-1)..(c-1)]
b_road = s[(b-1)..(d-1)]

if c > d
  road = s[(b-2)..d]
  unless road.include?('...')
    puts 'No'
    exit
  end
end

if a_road.include?('##') || b_road.include?('##')
  puts 'No'
else
  puts 'Yes'
end
