#include <bits/stdc++.h>
const int N = 100005;
const long double pi = 3.141592653;
const long long MOD = 1000000007;
long double eps = 1e-8;
using namespace std;
int dx[9] = {1, -1, 0, 0, 1, 1, -1, -1, 0};
int dy[9] = {0, 0, 1, -1, 1, -1, 1, -1, 0};
bool check(vector<long double> a, vector<long double> b, long double mf,
           long double mr) {
  long double mass = mr + mf, mfu = 0;
  long long i;
  for (i = 0; i < (long long)a.size(); i++) {
    mfu = (1 / a[i]) * mass;
    if (mfu > mf + eps)
      return false;
    else {
      mf = mf - mfu;
      mass = mr + mf;
      mfu = (1 / b[(i + 1) % (long long)a.size()]) * mass;
      if (mfu > mf + eps)
        return false;
      else {
        mf = mf - mfu;
        mass = mr + mf;
      }
    }
  }
  return true;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int T = 1;
  while (T--) {
    long double n, m, ans, lb, ub;
    long long i;
    cin >> n >> m;
    vector<long double> a(n), b(n);
    for (i = 0; i < n; i++) cin >> a[i];
    for (i = 0; i < n; i++) cin >> b[i];
    lb = 1e-10;
    ub = 1e9;
    ans = 1e10;
    while (lb <= ub) {
      long double mid = (lb + ub) / 2;
      if (check(a, b, mid, m)) {
        ans = min(ans, mid);
        ub = mid - (1e-10);
      } else
        lb = mid + (1e-10);
    }
    if (ans == 1e10)
      cout << -1;
    else
      cout << fixed << setprecision(10) << ans << " ";
  }
  return 0;
}
