lines = readlines.map(&:strip)

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

blocker_index = []
(s.size-1).times do |index|
  blocker_index.push(index) if (s[index..index+1].join)=='##'
end

blocker_index.each do |index|
  if (a-1 <= index && index <= c-1) || (b-1 <= index && index <= d-1)
    puts 'No'
    exit
  end
end

if (d < c)
  # first B
  if s[d]=='.' && s[d-2]=='.'
    puts 'No'
    exit
  end

  space_index = []
  (s.size-2).times do |index|
    space_index.push(index) if (s[index..index+2].join)=='...'
  end

  space_index.each do |index|
    if ((b-1 <= index && index <= d-1))
      puts 'Yes'
      exit
    end
  end

  # first A
  if s[b]=='.' && s[b-2]=='.' 
    puts 'Yes'
    exit
  end

  puts 'No'
else
  puts 'Yes'
end


