#include <bits/stdc++.h>
#pragma GCC optimize("O3")
using namespace std;
const int Maxn = 1026;
double m, a[Maxn], b[Maxn];
int n;
void init() {
  cin >> n >> m;
  for (int i = 1; i <= n; i++) cin >> a[i];
  for (int i = 1; i <= n; i++) cin >> b[i];
  b[int(n) + 1] = b[1];
}
void solve() {
  double l = 0, r = 1e9 + 1;
  while (l + 0.000001 < r) {
    double mid = (l + r) / 2.0;
    double f = mid;
    for (int i = 1; i <= n; ++i) {
      f -= (f + m) / double(a[i]);
      f -= (f + m) / double(b[i + 1]);
      if (f < 0) break;
    }
    if (f >= 0)
      r = mid;
    else
      l = mid;
  }
  if (r == 1e9 + 1)
    cout << -1;
  else
    cout << fixed << setprecision(10) << r;
}
int main() {
  init();
  solve();
  return 0;
}
