#include <bits/stdc++.h>
using namespace std;
long long n, m, k;
long long read() {
  long long s = 0, f = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    s = s * 10 + ch - '0';
    ch = getchar();
  }
  return s * f;
}
long long a[15];
long long dp[(1 << 14) + 1];
long long b1[20], b2[20];
long long inv[2020020];
long long t1, t2;
const long long mod = 1e9 + 7;
signed main() {
  long long T = 1;
  inv[1] = 1;
  inv[0] = 1;
  for (long long i = 2, iend = 2000000; i <= iend; ++i)
    inv[i] = 1ll * inv[mod % i] * (mod - mod / i) % mod;
  while (T--) {
    n = read();
    for (long long i = 0, iend = n - 1; i <= iend; ++i) a[i] = read();
    long long m = (1 << n) - 1;
    for (long long i = 1, iend = m; i <= iend; ++i) {
      dp[i] = 1;
      for (long long j = (i - 1) & i; j; j = (j - 1) & i) {
        long long k = i - j;
        t1 = t2 = 0;
        for (long long p = 0, pend = n - 1; p <= pend; ++p) {
          if (j & (1 << p)) {
            b1[++t1] = p;
          }
          if (k & (1 << p)) {
            b2[++t2] = p;
          }
        }
        long long nw = dp[j];
        for (long long f1 = 1, f1end = t1; f1 <= f1end; ++f1) {
          for (long long f2 = 1, f2end = t2; f2 <= f2end; ++f2) {
            nw *= a[b1[f1]];
            nw %= mod;
            nw *= inv[a[b1[f1]] + a[b2[f2]]];
            nw %= mod;
          }
        }
        dp[i] += mod, dp[i] -= nw, dp[i] %= mod;
      }
    }
    long long sum = 0;
    for (long long i = 1, iend = m; i <= iend; ++i) {
      t1 = t2 = 0;
      for (long long p = 0, pend = n - 1; p <= pend; ++p) {
        if (i & (1 << p)) {
          b1[++t1] = p;
        }
        if ((m ^ i) & (1 << p)) {
          b2[++t2] = p;
        }
      }
      long long nw = dp[i];
      for (long long f1 = 1, f1end = t1; f1 <= f1end; ++f1) {
        for (long long f2 = 1, f2end = t2; f2 <= f2end; ++f2) {
          nw *= a[b1[f1]];
          nw %= mod;
          nw *= inv[a[b1[f1]] + a[b2[f2]]];
          nw %= mod;
        }
      }
      nw *= t1;
      nw %= mod;
      sum += nw;
      sum %= mod;
    }
    cout << sum;
  }
}
