#include <bits/stdc++.h>
using namespace std;
const int INF = 1e9 + 322;
const long long LINF = 2e18 + 474;
const int N = 1e3 + 228;
const int MOD = 1e9 + 7;
const int iter = 322;
const double eps = 1e-10;
int n;
double m, ans = INF;
double a[N], b[N];
bool ok(double fuel) {
  double M = m + fuel;
  M -= M / a[0];
  for (int i = 1; i < n; i++) {
    M -= M / b[i];
    M -= M / a[i];
  }
  M -= M / b[0];
  return (M > m + eps);
}
void solve() {
  cin >> n >> m;
  for (int i = 0; i < n; i++) cin >> a[i];
  for (int j = 0; j < n; j++) cin >> b[j];
  double l = 0, r = INF;
  for (int i = 0; i < iter; i++) {
    double mid = (l + r) / 2.;
    if (ok(mid)) {
      ans = mid;
      r = mid - eps;
    } else {
      l = mid + eps;
    }
  }
  if (ans >= INF) {
    cout << -1;
    return;
  }
  cout << fixed << setprecision(6) << ans;
}
int main() {
  if (!1) {
    freopen(
        "474"
        ".in",
        "r", stdin);
    freopen(
        "474"
        ".out",
        "w", stdout);
  }
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int T = 1;
  while (T--) {
    solve();
  }
  return 0;
}
