#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cout << setprecision(25);
  long long n, m, a, b, c, d, i, j, k;
  cin >> n >> m;
  long long tk[n + 5];
  long long la[n + 5];
  long double p, q, r, s, ans;
  for (i = 0; i < n; i++) {
    cin >> tk[i];
  }
  for (i = 0; i < n; i++) {
    cin >> la[i];
  }
  p = (la[0] - 1);
  if (p <= 0) {
    cout << "-1";
    return 0;
  }
  q = m / p;
  long double curm = m + q;
  ;
  for (i = n - 1; i >= 1; i--) {
    p = tk[i] - 1;
    if (p <= 0) {
      cout << "-1";
      return 0;
    }
    q = curm / p;
    curm = curm + q;
    ;
    p = la[i] - 1;
    if (p <= 0) {
      cout << "-1";
      return 0;
    }
    q = curm / p;
    curm = curm + q;
    ;
  }
  p = tk[0] - 1;
  if (p <= 0) {
    cout << "-1";
    return 0;
  }
  q = curm / p;
  curm = curm + q;
  cout << curm - m;
  return 0;
}
