#include <bits/stdc++.h>
const int maxn = 1005;
int n, m;
int a[maxn], b[maxn];
bool solve(double v) {
  for (int i = 0; i < n; i++) {
    if ((m + v) / a[i] <= v)
      v -= (m + v) / a[i];
    else
      return false;
    if ((m + v) / b[i] <= v)
      v -= (m + v) / b[i];
    else
      return false;
  }
  if (v >= 0) return true;
  return false;
}
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 0; i < n; i++) {
    scanf("%d", &a[i]);
  }
  scanf("%d", &b[n - 1]);
  for (int i = 0; i < n - 1; i++) {
    scanf("%d", &b[i]);
  }
  double left = -1, right = 1e9 + 1;
  while (left + 0.000001 < right) {
    double mid = (left + right) / 2;
    if (solve(mid)) {
      right = mid;
    } else {
      left = mid;
    }
  }
  if (right > 1e9 + 0.00001)
    puts("-1");
  else
    printf("%f\n", right);
  return 0;
}
