#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cout.tie(0);
  cin.tie(0);
  double n, m;
  bool poss = 0;
  cin >> n >> m;
  vector<pair<double, double>> p(n + 1);
  for (int i = 0; i < n; ++i) cin >> p[i].first;
  for (int i = 0; i < n; ++i) cin >> p[i].second;
  double s = 1, e = 1e9 + 5, cnt = 100;
  while (cnt--) {
    double mid = (s + e) / 2, rem = 0;
    mid -= (m + mid) / p[0].first;
    for (int i = 1; i < n; ++i) {
      mid -= (m + mid) / p[i].second;
      mid -= (m + mid) / p[i].first;
    }
    mid -= (m + mid) / p[0].second;
    if (mid > -1e-6) poss = 1;
    if (mid > 0)
      e = (s + e) / 2;
    else
      s = (s + e) / 2;
  }
  cout << fixed << setprecision(6);
  if (poss)
    cout << (s + e) / 2;
  else
    cout << -1;
}
