#include <bits/stdc++.h>
using namespace std;
double a[100010], b[100010], c[100010];
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int32_t n;
  double m;
  cin >> n >> m;
  for (int32_t i = 0; i < n; i++) cin >> a[i];
  cin >> b[n - 1];
  for (int32_t i = 0; i < n - 1; i++) cin >> b[i];
  double l = 0;
  double h = 1e9 + 1;
  double ans = 1e9 + 1;
  while (l <= h) {
    double mid = (l + h) / 2;
    bool flag = true;
    double fuel = mid;
    for (int32_t i = 0; i < n; i++) {
      double t1 = (m + fuel) / a[i];
      fuel -= t1;
      if (fuel <= 0) {
        flag = false;
        break;
      }
      t1 = (m + fuel) / b[i];
      fuel -= t1;
      if (fuel < 0 || fuel == 0 && i != n - 1) {
        flag = false;
        break;
      }
    }
    if (flag) {
      ans = mid;
      h = mid - 0.0000001;
    } else
      l = mid + 0.0000001;
  }
  if (ans > 1e9) {
    cout << -1 << "\n";
    return 0;
  }
  cout << fixed << setprecision(10) << ans << "\n";
}
