#include <bits/stdc++.h>
using namespace std;
const long long N = 1000006, INF = 1e18, P = 1e9 + 7;
long long q = 1, n, m, x, y, z, l, r, k, a[N], b[N], dp[N], o[20][20], ans, w,
          e;
long long dvv(long long a, long long b) {
  long long p = P - 2, B = 1;
  while (p) {
    if (p % 2) {
      p--;
      (B *= b) %= P;
    } else {
      p >>= 1;
      (b *= b) %= P;
    }
  }
  return (a * B) % P;
}
long long aaa(int i, int e) {
  z = 1;
  for (int x = 0; x < n; x++)
    if (i & (1 << x))
      for (int y = 0; y < n; y++)
        if (!(i & (1 << y)) && (e & (1 << y))) (z *= o[x][y]) %= P;
  return (dp[i] * z) % P;
}
int main() {
  ios_base::sync_with_stdio(false), cin.tie(0);
  cin >> n;
  for (int i = 0; i < n; i++) cin >> a[i];
  for (int i = 0; i < n; i++)
    for (int j = 0; j < n; j++) o[i][j] = dvv(a[i], (a[i] + a[j]));
  for (int i = 1; i < (1 << n); i++) {
    dp[i] = 1;
    for (int j = (i - 1) & i; j; j = (j - 1) & i)
      dp[i] = (dp[i] - aaa(j, i) + P) % P;
    (ans += aaa(i, (1 << n) - 1) * __builtin_popcount(i)) %= P;
  }
  cout << ans;
}
