n, a, b, c, d = *gets.chomp.split.map(&:to_i)
s = gets.chomp.split(//)
s[a - 1] = 'A'
s[b - 1] = 'B'
s[c - 1] = 'C'
s[d - 1] = 'D'
can_jump_flag = false
s.each_cons(3) do |ss|
  if ss == %w[A # #] || ss == %w[A # #] || ss == %w[B # #] || ss == %w[# # A] || ss == %w[# # B] || ss == %w[# # .] || ss == %w[. # #] || ss == %w[# # #] || ss == %w[# # C] || ss == %w[# # D]
    puts 'No'
    exit
  end

  if c < d
    puts 'Yes'
    exit
  end

  if ss == %w[A B .] || ss == %w[. . .] || ss == %w[B . .]
    can_jump_flag = true
  end
end

if can_jump_flag
  puts 'Yes'
else
  puts 'No'
end
