#include <bits/stdc++.h>
using namespace std;
const int N = 15, mod = 1e9 + 7;
int n, ans, a[N], dp[(1 << N)], pd[(1 << N)], mv[(1 << N)], sum[(1 << N)],
    Pow[(1 << N)][N];
long long pow(long long x, long long y, long long mod) {
  return (!y ? 1 : pow(x * x % mod, y / 2, mod) * (y & 1 ? x : 1)) % mod;
}
int Cnt(int mask) { return __builtin_popcount(mask); }
void solve(int mask) {
  int m = 0, res = 0, t = 0;
  mv[mask] = 1;
  for (int i = 0; i < n; i++) {
    if (mask & (1 << i)) {
      t++;
      for (int j = 0; j < i; j++) {
        if (mask & (1 << j)) {
          mv[mask] = 1ll * mv[mask] * (a[i] + a[j]) % mod;
        }
      }
    }
  }
  int inv = (1 << n) - mask - 1;
  m = ((inv + 1) & mask);
  while (m) {
    pd[mask] = (pd[mask] + 1ll * dp[m] * (pd[mask - m] + dp[mask - m]) % mod *
                               Pow[m][Cnt(mask - m)] % mod) %
               mod;
    m = (((m | inv) + 1) & mask);
  }
  dp[mask] = (mv[mask] + mod - pd[mask]) % mod;
}
int main() {
  mv[0] = 1;
  cin >> n;
  for (int i = 0; i < n; i++) cin >> a[i];
  for (int mask = 0; mask < (1 << n); mask++) {
    Pow[mask][0] = Pow[mask][1] = 1;
    for (int j = 0; j < n; j++)
      if (mask & (1 << j)) Pow[mask][1] = 1ll * Pow[mask][1] * a[j] % mod;
    for (int i = 2; i < N; i++)
      Pow[mask][i] = 1ll * Pow[mask][i - 1] * Pow[mask][1] % mod;
  }
  for (int i = 1; i < (1 << n); i++) {
    solve(i);
  }
  for (int mask = 1; mask < (1 << n); mask++) {
    ans = (ans + 1ll * Cnt(mask) * dp[mask] % mod * Pow[mask][n - Cnt(mask)] %
                     mod * mv[(1 << n) - mask - 1] % mod) %
          mod;
  }
  cout << 1ll * ans * pow(mv[(1 << n) - 1], mod - 2, mod) % mod;
}
