#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  double a[n + 2], b[n + 2];
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
    if (a[i] == 1) {
      cout << -1 << endl;
      return 0;
    }
  }
  for (int i = 1; i <= n; i++) {
    cin >> b[i];
    if (b[i] == 1) {
      cout << -1 << endl;
      return 0;
    }
  }
  double l = 0, r = 1e9;
  while (l < r) {
    bool f = true;
    double mid = (l + r) / 2;
    double p = mid + m, pp = mid;
    for (int i = 1; i < n; i++) {
      pp = pp - p / a[i];
      p = m + pp;
      pp = pp - p / b[i + 1];
      p = m + pp;
    }
    pp = pp - p / a[n];
    p = m + pp;
    pp = pp - p / b[1];
    p = m + pp;
    if (r - l < 1e-6) break;
    if (pp >= 0) {
      r = mid;
    } else
      l = mid;
  }
  printf("%.10f", l);
  return 0;
}
