#include <bits/stdc++.h>
using namespace std;
int main() {
  std::ios::sync_with_stdio(false);
  int n;
  double m, mm;
  cin >> n >> mm;
  m = mm;
  double *a = new double[n];
  double *b = new double[n];
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
    if (a[i] == 1) {
      cout << -1;
      return 0;
    }
  }
  for (int i = 0; i < n; ++i) {
    cin >> b[i];
    if (b[i] == 1) {
      cout << -1;
      return 0;
    }
  }
  double x = m / (b[0] - 1);
  m += x;
  for (int i = n - 1; i > 0; --i) {
    x = m / (a[i] - 1);
    m += x;
    x = m / (b[i] - 1);
    m += x;
  }
  x = m / (a[0] - 1);
  m += x;
  cout << fixed << setprecision(10) << m - mm;
  return 0;
}
