import java.io._
import java.util.StringTokenizer

class InputReader(stream: InputStream) {
  private val reader = new BufferedReader(new InputStreamReader(stream))
  private var tokenizer: StringTokenizer = new StringTokenizer(reader.readLine())
  def next(): String = {
    while (!tokenizer.hasMoreTokens()) {
      tokenizer = new StringTokenizer(reader.readLine())
    }
    tokenizer.nextToken()
  }
}

//  pas = pascal(n)
//  nCk = pas(k)
//  n = 0 に対応していない
object Pascal{
  val MOD = 1e9.toInt + 7

  def pascal(n: Int): List[Int] = {
    // 次の段を作る
    def makeNext(list: List[Int], res: List[Int]): List[Int] = {
      list match{
        case x :: Nil => res :+ 1
        case x :: y :: list2 => makeNext(y :: list2, res :+ ((x+y)%MOD))
        case _ => throw new Exception("invalid list")
      }
    }

    // n回再起
    def pascalFunc(list: List[Int]): List[Int] = {
      (list.length > n) match{
        case true  => list
        case false => pascalFunc(makeNext(list, List(1)))
      }
    }

    pascalFunc(List(1))
  }
}



object Main extends App {
  import Pascal._
  val in = new InputReader(System.in)
 
  val n = in.next().toInt
  val a = new Array[Int](n)
  for(i <- 0 until n)
    a(i) = in.next().toInt


  ////
  val pas = pascal(n+1)
}
