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).with_index do |ss, ssi|
  # if ss == %w[A # #] || ss == %w[A # #] || ss == %w[B # #] || ss == %w[# # A] || ss == %w[# # B] || ss == %w[# # C] || ss == %w[# # D]
  #   puts 'No'
  #   exit
  # end

  # if (ss == %w[# # .] || ss == %w[. # #] || ss == %w[# # #]) && (b+1 < ssi) && (ssi < c-3)
  #   puts 'No'
  #   exit
  # end

  if c < d
    puts 'Yes'
    exit
  end
# [b..(c-2)]p

  if ss == %w[A B .] || ss == %w[B . .]
    puts 'Yes'
    exit
    #can_jump_flag = true
  end

  if ss == %w[. . .] && (b-1 < ssi) && (ssi < c-3)
    puts 'Yes'
    exit
  end
end
puts 'No'
# if can_jump_flag
#   puts 'Yes'
# else
#   puts 'No'
# end
