#include<bits/stdc++.h>
long long p = 1000000007;
using namespace std;
int main()
{
#ifndef ONLINE_JUDGE
freopen(“input.txt”, “r”, stdin);
freopen(“output.txt”, “w”, stdout);
#endif
long long x;
cin >> x;
vector<long long> vec;
vec.resize(x);
long long nOfDivisors = 1;
for (long long i = 0; i<x; i++)
{
cin >> vec[i];
nOfDivisors = (nOfDivisors*(vec[i] + 1)) % p;
}
long long ans = 1;
for (long long i = 0; i<x; i++)
{
vec[i] = (nOfDivisors*vec[i])%p;
vec[i] = (vec[i]*500000004)%p; // 500000004 is mod_inv(2,1000000007);
ans = (ans*(vec[i] + 1)) % p;
}
cout << ans << endl;
//cin >> x;
return 0;
}