#include <bits/stdc++.h>
using namespace std;
long long mypower(long long a, long long b) {
  long long ans = 1;
  while (b) {
    if (b % 2) ans = ans * a % 1000000007;
    b = b / 2;
    a = a * a % 1000000007;
  }
  return ans;
}
void SieveOfEratosthenes(vector<bool> &prime, long long n) {
  for (long long p = 2; p * p <= n; p++) {
    if (prime[p] == true) {
      for (long long i = p * p; i <= n; i += p) prime[i] = false;
    }
  }
}
void solve() {
  long long n;
  cin >> n;
  double w;
  cin >> w;
  cout << fixed << setprecision(10);
  vector<double> a(n), b(n);
  for (long long i = 0; i < n; i++) cin >> a[i];
  for (long long i = 0; i < n; i++) cin >> b[i];
  double ans = 0, tot = 0;
  long long j = 0;
  bool flg = true;
  for (long long i = 0, j = n - 1; i < n && j >= 0; i++, j--) {
    if (a[j] == 1 || b[i] == 1) {
      flg = false;
      break;
    }
    double tmp = (w + ans) / (b[i] - 1);
    ans += tmp;
    tmp = (w + ans) / (a[j] - 1);
    ans += tmp;
  }
  if (flg)
    cout << ans << endl;
  else
    cout << "-1" << endl;
}
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
