#include <bits/stdc++.h>
#pragma comment(linker, "/stack:16777216")
using namespace std;
const int INF = 1000000000;
const int MAX = 1024;
const int LEN = 21;
const int BASE = 1000000000;
const double EPS = 1e-7;
int n, m;
int A[MAX];
int B[MAX];
bool check(double x) {
  for (int i = (0); i < (n); ++i) {
    x -= (m + x) / A[i];
    if (x < 0) return 0;
    x -= (m + x) / B[i];
    if (x < 0) return 0;
  }
  return 1;
}
int main() {
  cin >> n >> m;
  for (int i = (0); i < (n); ++i) cin >> A[i];
  for (int i = (0); i < (n); ++i) cin >> B[i];
  double l = 0, r = 1e+10;
  for (int it = (0); it < (256); ++it) {
    double m = (l + r) / 2;
    if (check(m))
      r = m;
    else
      l = m;
  }
  if (l > 2e+9)
    cout << -1 << endl;
  else
    printf("%0.11f\n", l);
  return 0;
}
