n,a,b,c,d = gets.split.map {|x| x.to_i}
$s = gets.chop


def check(a,d, ch)
  i = a
  while i < d-1
    if $s[i] == ch and $s[i+1] == ch
      return true
    end
    i += 1
  end
  return false    
end

if c < d
  if check(a,d,"#")
    puts "NO"
  else
    puts "YES"
  end
else
  if check(a,c,"#")
    puts "NO"
  elsif check(b,d,".")
    puts "YES"
  else
    puts "NO"
  end
end
