#include <bits/stdc++.h>
using namespace std;
long long mod = 27449;
int inf = 1e9;
double eps = 1e-2;
ifstream in("input.txt");
ofstream out("output.txt");
int main() {
  int n;
  double m;
  cin >> n >> m;
  vector<double> a, b;
  for (int i = 0; i < n; i++) {
    double t;
    cin >> t;
    if (t == 1) {
      cout << -1;
      return 0;
    }
    a.push_back(t);
  }
  for (int i = 0; i < n; i++) {
    double t;
    cin >> t;
    if (t == 1) {
      cout << -1;
      return 0;
    }
    b.push_back(t);
  }
  double ans = 0;
  ans += m / (b[0] - 1);
  m += ans;
  for (int i = n - 1; i >= 1; i--) {
    double t = m / (b[i] - 1);
    ans += t;
    m += t;
    t = m / (a[i] - 1);
    ans += t;
    m += t;
  }
  ans += m / (a[0] - 1);
  cout << std::setprecision(30) << ans;
  return 0;
}
