#include <bits/stdc++.h>
using namespace std;
const int N = 1005;
vector<long double> a(N), b(N);
int n;
long double m;
bool getans(long double _try) {
  long double reqd = _try + m;
  int i;
  for (i = 1; i < n; i++) {
    reqd -= (reqd / a[i]);
    reqd -= (reqd / b[i + 1]);
  }
  reqd -= (reqd / a[n]);
  reqd -= (reqd / b[1]);
  return (reqd >= m);
}
int main(int argc, char const *argv[]) {
  int i, j, c = 0;
  cin >> n >> m;
  for (i = 1; i <= n; i++) cin >> a[i];
  for (i = 1; i <= n; i++) cin >> b[i];
  long double low = 0, high = 1e10, mid;
  while (low + (1 / 1e6) < high) {
    mid = (low + high) / 2;
    if (getans(mid)) {
      high = mid;
      c = 1;
    } else
      low = mid;
  }
  if (high == 1e10) return cout << -1, 0;
  cout << fixed << setprecision(10) << high;
  return 0;
}
