#include <bits/stdc++.h>
using namespace std;
double j, k, m, ans, x, a[1009], b[1009], sum, f;
int i, n;
int main() {
  cin >> n >> k;
  for (i = 0; i < n; i++) cin >> a[i];
  for (i = 0; i < n; i++) cin >> b[i];
  double lo = 0, hi = 1e9, mid, c = 100;
  while (c--) {
    mid = (lo + hi) / 2.0;
    x = mid + k;
    for (i = 1; i < n - 1; i++) {
      x -= (x / a[i]);
      x -= (x / b[i]);
    }
    x -= (x / a[0]);
    x -= (x / a[n - 1]);
    x -= (x / b[0]);
    x -= (x / b[n - 1]);
    if (x < k)
      lo = mid + .00000001;
    else {
      hi = mid - 0.00000001;
      f = 1;
    }
  }
  if (!f)
    cout << -1 << endl;
  else
    printf("%.7f\n", mid);
  return 0;
}
