fun main(args: Array<String>) {
  val (n, aRaw, bRaw, cRaw, dRaw) = readLine()!!.split(" ").map { it.toInt() }
  val a = aRaw - 1
  val b = bRaw - 1
  val c = cRaw - 1
  val d = dRaw - 1
  val s = readLine()!!

  fun isGoodRange(from: Int, inclusiveTo: Int): Boolean {
    for (i in (from + 1)..(inclusiveTo - 2)) {
      if (s[i] == '#' && s[i + 1] == '#') {
        return false
      }
    }
    return true
  }

  fun solve(): Boolean {
    if (c < d) {
      return isGoodRange(a, c) && isGoodRange(b, d)
    } else {
      if (!isGoodRange(a, c) || !isGoodRange(b, d)) {
        return false
      }
      var ok = false
      for (i in b..d) {
        if (s[i - 1] == '.' && s[i] == '.' && s[i + 1] == '.') {
          ok = true
        }
      }
      return ok
    }
  }

  println(if (solve()) "Yes" else "No")
}