import scala.io.StdIn

object Main extends App {

  val n = StdIn.readInt
  val a = StdIn.readLine.split(" ").map(_.toLong)

  val (odd, even, mlt4) = a./:(0,0,0)((cnt,i) => {
    val odd = if((i&1) == 1) 1 else 0
    val even = if((i&1) == 0) 1 else 0
    val mlt4 = if((i&3) == 0) 1 else 0
    (cnt._1+odd, cnt._2+even, cnt._3+mlt4)
  })

  val ans = if(odd == mlt4+1) {
    if(even == mlt4) "Yes"
    else "No"
  }
  else if(odd <= mlt4) "Yes" else "No"

  println(ans)
}