#include #include #include #include #include #include #include using namespace std; using ll = long long; constexpr int P = 1000000007; int main() { ios::sync_with_stdio(false); cin.tie(0); int t; cin >> t; while (t--) { int n; cin >> n; ll r = 1; for (int i = 0; i < n; i++) { int a; cin >> a; r = r * (a + 1) % P; } r += P - 1; r %= P; cout << r << '\n'; } return 0; }