#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
const int N = (int)5e5 + 7;
const int inf = (int)1e9 + 7;
const int mod = (int)1e9 + 7;
const long long linf = (long long)1e18 + 7;
const double eps = 1e-7;
const int dx[] = {-1, 0, 1, 0, 1, -1, -1, 1};
const int dy[] = {0, 1, 0, -1, 1, -1, 1, -1};
using namespace std;
int n;
double m;
int a[N], b[N];
bool check(double x) {
  for (int i = (1); i <= (n); i++) {
    if (i > 1) {
      double need = (m + x) / b[i];
      x -= need;
    }
    if (x <= 0) return 0;
    double need = (m + x) / a[i];
    x -= need;
    if (x <= 0) return 0;
  }
  double need = (m + x) / b[1];
  x -= need;
  if (x < 0) return 0;
  return 1;
}
int main() {
  ios_base ::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  cin >> n >> m;
  for (int i = (1); i <= (n); i++) cin >> a[i];
  for (int i = (1); i <= (n); i++) cin >> b[i];
  double l = 0, r = 1e9 + 7;
  while (r - l > eps) {
    double mid = (l + r) / 2;
    if (check(mid))
      r = mid - eps;
    else
      l = mid + eps;
  }
  if (r == (double)1e9 + 7) cout << -1, exit(0);
  cout << setprecision(10) << fixed << r;
  exit(0);
}
