intmain() { init(); auto solve = [&](auto &self, poly *a, int l, int r) -> poly { if (l == r) return a[l]; int mid = (l + r) >> 1; returnself(self, a, l, mid) * self(self, a, mid + 1, r); }; int n, m, k; std::vector<poly> all; std::cin >> m >> n >> k; for (int i = 1, v; i <= m; ++ i) { scanf("%d", &v); poly cur(v); for (int i = 0; i < v; ++ i) cur[i] = (LL) C(v - 1, v - 1 - i) * infact[v - i] % Mod; all.push_back(cur); } auto g = solve(solve, all.data(), 0, (int) all.size() - 1); for (int i = 0; i <= n - m; ++ i) g[i] = (LL) g[i] * fact[n - i] % Mod; /*for (int &x : g) printf("%d ", x); puts("");*/ int res = 0; for (int i = k, op = 1; i <= n - m; ++ i, op = Mod - op) res = (res + (LL) op * C(i, k) % Mod * g[i]) % Mod; std::cout << res << std::endl; return0; }