#include <bits/stdc++.h>
using namespace std;
const int N = 1e3 + 2;
int n, m, a[N], b[N];
bool Check(double fuel) {
  for (int i = 0; i < n; ++i) {
    fuel -= (fuel + m) / a[i];
    if (fuel < 0) return false;
    fuel -= (fuel + m) / b[(i + 1) % n];
    if (fuel < 0) return false;
  }
  return fuel >= 0;
}
int main() {
  cin >> n >> m;
  for (int i = 0; i < n; ++i) cin >> a[i];
  for (int i = 0; i < n; ++i) cin >> b[i];
  for (int i = 0; i < n; ++i)
    if (a[i] == 1 || b[i] == 1) {
      cout << -1;
      return 0;
    }
  double lo = 1, hi = 1e9 + 10, ans = -1;
  for (int times = 0; times < 100; ++times) {
    double mid = (lo + hi) / 2;
    if (Check(mid))
      ans = hi = mid;
    else
      lo = mid;
  }
  if (ans > 0)
    cout << setprecision(6) << fixed << ans;
  else
    cout << -1;
  return 0;
}
