#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  double a[1001], b[1001], ans;
  cin >> n >> m;
  for (int i = 0; i < n; i++) cin >> a[i];
  for (int i = 0; i < n; i++) cin >> b[i];
  double lo = 1.00, hi = 1000000001.00, mid;
  ans = 1000000001.0;
  while (lo < hi) {
    if (hi - lo < .00000001) break;
    mid = lo + (hi - lo) / 2;
    double init_wt = mid + double(m);
    for (int i = 0; i < n - 1; i++) {
      init_wt = init_wt - init_wt / a[i];
      init_wt = init_wt - init_wt / b[i + 1];
    }
    init_wt = init_wt - init_wt / a[n - 1];
    init_wt = init_wt - init_wt / b[0];
    if (init_wt < m) {
      lo = mid + .0000000001;
      mid = 1000000001.00;
    } else {
      hi = mid;
      ans = min(ans, mid);
    }
  }
  if (ans != 1000000001.0)
    printf("%0.10lf\n", ans);
  else
    printf("-1\n");
}
