#include <bits/stdc++.h>
using namespace std;
const double eps = 1e-9;
int fx[] = {-1, 1, 0, 0, -1, -1, 1, 1};
int fy[] = {0, 0, -1, 1, -1, 1, -1, 1};
int kx[] = {1, 1, 2, 2, -1, -1, -2, -2};
int ky[] = {2, -2, 1, -1, 2, -2, 1, -1};
int TLx[] = {0, -1, -1, 0};
int TLy[] = {-1, -1, 0, 0};
int TRx[] = {-1, -1, 0, 0};
int TRy[] = {0, 1, 1, 0};
int BLx[] = {0, 1, 1, 0};
int BLy[] = {-1, -1, 0, 0};
int BRx[] = {0, 1, 1, 0};
int BRy[] = {1, 1, 0, 0};
int n;
double m;
double lift[1010], land[1010];
double ans, mid, R = 1000000010;
bool ok;
void check(double fuel) {
  double tot = m + fuel;
  fuel -= (tot / lift[1]);
  tot = m + fuel;
  for (int i = 2; i <= n; i++) {
    fuel -= (tot / land[i]);
    tot = m + fuel;
    fuel -= tot / lift[i];
    tot = m + fuel;
  }
  fuel -= tot / land[1];
  if (fuel < 0) {
    ok = false;
    return;
  }
  tot = m + fuel;
  if (tot >= m) {
    ok = true;
  } else
    ok = false;
}
void BIN() {
  double l = 1, r = R;
  for (int i = 1; i <= 70; i++) {
    mid = (l + r) / 2;
    check(mid);
    if (ok) {
      ans = mid;
      r = mid;
    } else
      l = mid;
  }
}
int main() {
  cin >> n >> m;
  for (int i = 1; i <= n; i++) {
    cin >> lift[i];
  }
  for (int i = 1; i <= n; i++) {
    cin >> land[i];
  }
  BIN();
  if (ans <= 0) {
    cout << "-1" << endl;
    return 0;
  }
  cout << fixed << setprecision(10) << ans << endl;
  return 0;
}
