#include <bits/stdc++.h>
using namespace std;
int main() {
  double m;
  int n;
  cin >> n >> m;
  double a[n], b[n];
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
  }
  for (int i = 0; i < n; ++i) {
    cin >> b[i];
  }
  double lo = 0, hi = 1000000007;
  while (abs(lo - hi) > 1e-7) {
    double mid = (lo + hi) / 2;
    double x = mid;
    x -= ((m + x) / a[0]);
    if (x < 0) {
      lo = mid;
      continue;
    }
    for (int i = 1; i < n; i++) {
      x -= ((m + x) / b[i]);
      if (x < 0) {
        lo = mid;
        continue;
      }
      x -= ((m + x) / a[i]);
      if (x < 0) {
        lo = mid;
        continue;
      }
    }
    x -= ((m + x) / b[0]);
    if (x < 0) {
      lo = mid;
      continue;
    }
    hi = mid;
  }
  if (lo > 1000000000) {
    cout << "-1\n";
  } else {
    cout << fixed << setprecision(8);
    cout << lo << '\n';
  }
}
