#include using namespace std; using namespace chrono; #if __has_include() #include using namespace atcoder; #endif using mint = modint1000000007; int main() { int64_t n; cin >> n; vector as(n); for (auto &&a : as) { int64_t x; cin >> x; a = x; } for (int64_t i = 0; i < n - 1; i++) { vector bs; for (int64_t j = 0; j + 1 < as.size(); j++) { bs.push_back(as[j] + as[j + 1]); } as = bs; } cout << as[0].val() << endl; return 0; }