#include <bits/stdc++.h>
using namespace std;
const int inf = 0x3f3f3f3f;
inline long long read() {
  long long x = 0, f = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = (x << 1) + (x << 3) + (ch ^ 48);
    ch = getchar();
  }
  return x * f;
}
const long double eps = 1e-9;
long long mod = 998244353;
const long long N = 1e6 + 5;
long long n, m;
long long a[N], b[N];
long double p[N];
long long tim = 0;
signed main() {
  scanf("%lld", &n), scanf("%lld", &m);
  long double x = m;
  for (long long i = 1; i <= n; i++) {
    scanf("%lld", &a[i]);
    if (a[i] == 1) {
      cout << -1;
      return 0;
    }
  }
  for (long long i = 1; i <= n; i++) {
    scanf("%lld", &b[i]);
    if (b[i] == 1) {
      cout << -1;
      return 0;
    }
  }
  for (long long i = 1; i <= n - 1; i++) p[++tim] = a[i], p[++tim] = b[i + 1];
  p[++tim] = a[n], p[++tim] = b[1];
  long double ans = 0;
  for (long long i = 2 * n; i >= 1; i--) {
    long double res = x / (p[i] - 1);
    x += res;
    ans += res;
  }
  printf("%.7Lf\n", ans);
}
