#include<iostream>
#include<cstring>
#include<cmath>
#include<cstdio>
#include<algorithm>
using namespace std;
const int inf = 0x7f7f7f;
const int mod = 1e9 + 7;
typedef long long ll;

ll a[1010];



ll qpow(ll b, ll c) {
ll ans = 1;

while(c) {
if(c & 1)
ans = ans * b % mod;
b = b * b % mod;
c >>= 1;
}

return ans;
}



int main() {
//ios::sync_with_stdio(false);
#ifdef LOCAL
//freopen(".in", "r", stdin);
//freopen(".out", "w", stdout);
#endif

int n;
while(scanf("%d", &n) == 1) {
for(int i = 0; i < n; i++)
scanf("%lld", &a[i]);


ll ans = 0;
for(int i = 0; i < n; i++) {
ll mul = 1;


for(int j = 0; j < n; j++) {
if(j != i) {
mul *=  (a[j] * a[j] % mod - a[i] * a[i] % mod);
mul %= mod;
}
}


ans += (qpow(2 * a[i] % mod * mul % mod, mod - 2));
}

ans %= mod;
ans += mod; //确保ans最终为正
ans %= mod;
cout << ans << endl;
}
}