#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1000000007;
const int INF = 1000000007;
vector<int> binaryRepresentation(int x) {
  vector<int> a(32);
  int i = 0;
  while (x > 0) {
    if (x % 2 == 0)
      a[i] = 0;
    else
      a[i] = 1;
    i++;
    x = x / 2;
  }
  return a;
}
long long fastPow(int x, int y) {
  vector<int> a = binaryRepresentation(y);
  int s = floor(log2(y)) + 1;
  cout << s << endl;
  vector<long long> pows(s);
  pows[0] = x;
  for (int i = 1; i < s; i++) {
    pows[i] = (pows[i - 1] * pows[i - 1]) % MOD;
  }
  for (int i = 0; i < (pows).size(); ++i) cout << pows[i] << " ";
  cout << endl;
  ;
  for (int i = 0; i < (a).size(); ++i) cout << a[i] << " ";
  cout << endl;
  ;
  long long res = 1;
  for (int i = 0; i < s; i++) {
    if (a[i]) res = (res * pows[i]) % MOD;
  }
  return res;
}
long long fact(int d) {
  long long res = 1;
  for (int i = 1; i <= d; i++) {
    res = (res * i) % MOD;
  }
  return res;
}
vector<int> a;
int n;
int m;
int isPossible(long double k) {
  for (int i = 0; i < n; i++) {
    k -= (m + k) / a[i];
  }
  if (k < 0) return 0;
  if (k >= 0) return 1;
}
int main() {
  cin >> n;
  cin >> m;
  a.resize(2 * n);
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    if (a[i] == 1) {
      cout << -1 << endl;
      return 0;
    }
  }
  for (int i = 0; i < n; i++) {
    cin >> a[n + i];
    if (a[n + i] == 1) {
      cout << -1 << endl;
      return 0;
    }
  }
  n *= 2;
  long double l = 0;
  long double r = pow(10, 9) + 10;
  while (r - l > 0.000000001) {
    long double m = (r + l) / 2;
    if (isPossible(m)) {
      r = m;
    } else {
      l = m;
    }
  }
  cout << setprecision(20) << l << endl;
}
