#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  int n, w;
  cin >> n >> w;
  vector<int> a(n), b(n);
  for (int& v : a) cin >> v;
  for (int& v : b) cin >> v;
  double l = 0, r = 2e9;
  for (int t = 0; t < 500; t++) {
    double m = (l + r) / 2;
    double now = m;
    for (int i = 0; i < n && now >= 0; i++) {
      now -= (w + now) / a[i];
      if (now < 0) break;
      now -= (w + now) / b[(i + 1) % n];
    }
    if (now >= 0)
      r = m;
    else
      l = m;
  }
  if (r == 2e9)
    cout << -1 << '\n';
  else
    cout << fixed << setprecision(10) << r << '\n';
}
