require 'pp'

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

stage = ['-']
s.chars.each_with_index do |str, i|
  stage[i + 1] = str == '.' ? '.' : '#'
end
stage[a] = 'A'
stage[b] = 'B'

lastb = b
loop do
  if stage[b + 1] == '.'
    stage[b] = '.'
    stage[b + 1] = 'B'
    b += 1
  elsif stage[b + 2] == '.'
    stage[b] = '.'
    stage[b + 2] = 'B'
    b += 2
  end
  break if stage[d] == 'B'
  if lastb == b
    puts 'No'
    return
  end
  lastb = b
end


lasta = a
loop do
  if stage[a + 1] == '.'
    stage[a] = '.'
    stage[a + 1] = 'A'
    a += 1
  elsif stage[a + 2] == '.'
    stage[a] = '.'
    stage[a + 2] = 'A'
    a += 2
  end
  break if stage[c] == 'A'
  if lasta == a
    puts 'No'
    return
  end
  lasta = a
end

puts 'Yes'
