#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1010;
const double eps = 1e-10;
int n, m;
int a[MAXN], b[MAXN];
double ABS(double x) { return x > 0 ? x : -x; }
bool fun(double x) {
  double leftTon(x);
  for (int i = 1; i <= n; i++) {
    int from(i), to(i + 1);
    if (to == n + 1) to = 1;
    double need((m + leftTon) / a[from]);
    if (need > leftTon) return false;
    leftTon -= need;
    need = (m + leftTon) / b[to];
    if (need > leftTon) return false;
    leftTon -= need;
  }
  return true;
}
int main() {
  while (~scanf("%d %d", &n, &m)) {
    for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
    for (int i = 1; i <= n; i++) scanf("%d", &b[i]);
    double left(0.0), right(1e9 + 1), ans(-1);
    double lastMid(-1), mid(-1);
    while (ABS(right - left) > eps) {
      lastMid = mid;
      mid = (right + left) / 2;
      if (fun(mid)) {
        ans = mid;
        right = mid;
      } else
        left = mid;
      if (ABS(mid - lastMid) < eps) break;
    }
    if (ans == -1)
      printf("-1\n");
    else
      printf("%.8f\n", ans);
  }
  return 0;
}
