#include <bits/stdc++.h>
using namespace std;
double a[1010], b[1010];
int main() {
  int n;
  double m;
  cin >> n;
  cin >> m;
  for (int i = 1; i <= n; i++) scanf("%lf", &a[i]);
  for (int i = 1; i <= n; i++) scanf("%lf", &b[i]);
  double l = 0;
  double r = 1e10;
  while (r - l > 1e-9) {
    double mid = (l + r) / 2;
    double you = m + mid;
    bool flag = true;
    double res = you / a[1];
    you -= res;
    if (you < m) flag = false;
    for (int i = 2; i <= n; i++) {
      res = you / b[i];
      you -= res;
      if (you < m) flag = false;
      res = you / a[i];
      you -= res;
      if (you < m) flag = false;
    }
    res = you / b[1];
    you -= res;
    if (you < m) flag = false;
    if (flag)
      r = mid;
    else
      l = mid;
  }
  if (r > 9e9)
    cout << -1 << endl;
  else
    cout << fixed << setprecision(8) << r << endl;
  return 0;
}
