#include <bits/stdc++.h>
using namespace std;
const int maxn = 1010;
double a[maxn];
double b[maxn];
long long int n, m;
bool chk(double k) {
  double cw = m + k;
  for (int i = 0; i < n; i++) {
    cw -= cw / a[i];
    cw -= cw / b[i];
  }
  return cw >= m;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  ;
  cin >> n;
  cin >> m;
  for (int i = 0; i < n; i++) cin >> a[i];
  for (int i = 0; i < n; i++) cin >> b[i];
  double l = 0, r = 1e10;
  for (int i = 0; i < 100; i++) {
    double k = l + (r - l) / 2;
    if (chk(k) == 1) {
      r = k;
    } else
      l = k;
  }
  if (l > 2e9) {
    cout << -1;
  } else {
    cout << fixed << setprecision(7);
    cout << l;
    cout << "\n";
  }
}
