#include <bits/stdc++.h>
using namespace std;
int a[1000 + 10];
int b[1000 + 10];
int main() {
  ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  int n, m;
  cin >> n >> m;
  int mx = 0;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    mx += a[i];
  }
  for (int i = 0; i < n; i++) {
    cin >> b[i];
    mx += b[i];
  }
  double s = 0;
  double t = INT_MAX;
  bool flag = false;
  double mid, x;
  double ans;
  double eps = 0.00000001;
  while (t - s > eps && !flag) {
    mid = (s + t) / 2;
    x = mid;
    ans = 0;
    for (int i = 0; i < n; i++) {
      ans = (mid + m) / a[i];
      mid -= ans;
      if (i == n - 1)
        ans = (mid + m) / b[0];
      else
        ans = (mid + m) / b[i + 1];
      mid -= ans;
    }
    if (mid <= eps && mid >= 0) {
      flag = true;
      break;
    } else if (mid < 0)
      s = x;
    else
      t = x;
  }
  if (flag) {
    cout << fixed << setprecision(7) << x;
  } else {
    cout << -1;
  }
  return 0;
}
