#include <bits/stdc++.h>
using namespace std;
int a[200005], b[200005], n, m;
bool g(long double curr) {
  long double wei = curr;
  int i;
  for (i = 1; i <= n; i++) {
    long double ded = (m + curr) / a[i];
    if (ded > curr) return false;
    curr -= ded;
    if (curr == 0) return false;
    ded = (i == n) ? ((m + curr) / b[1]) : ((m + curr) / b[i + 1]);
    if (ded > curr) return false;
    curr -= ded;
    if (i != n && curr == 0) return false;
  }
  return true;
}
long double f() {
  long double l = 0, r = 1000000000, mid;
  while (abs(r - l) > 0.000000001) {
    mid = (l + r) / 2;
    bool x = g(mid);
    if (x) {
      if (abs(r - mid) < 0.000000001) break;
      r = mid - 0.000000001;
    } else {
      if (abs(l - mid) < 0.000000001) break;
      l = mid + 0.000000001;
    }
  }
  if (g(l)) return l;
  if (g(r)) return r;
  if (g(l + 0.0000001)) return l + 0.0000001;
  if (g(r + 0.0000001)) return r + 0.0000001;
  return -1;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  ;
  cin >> n;
  cin >> m;
  int i, j, k;
  for (i = 1; i <= n; i++) {
    cin >> a[i];
    if (a[i] == 1) {
      cout << -1 << "\n";
      return 0;
    }
  }
  for (i = 1; i <= n; i++) {
    cin >> b[i];
  }
  long double ans = f();
  cout << fixed << setprecision(11) << ans;
}
