#include <bits/stdc++.h>
const int N = 1e5 + 7;
const double eps = 2e-7;
using namespace std;
int mp[100][100];
int a[1005], b[1005];
int n, m;
bool check(double x) {
  double now = m + x;
  for (int i = 1; i < n; i++) {
    now = now - (now / a[i]);
    if (now < m) return 0;
    now = now - (now / b[i + 1]);
    if (now < m) return 0;
  }
  now = now - (now / a[n]);
  if (now < m) return 0;
  now = now - (now / b[1]);
  if (now < m) return 0;
  return 1;
}
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  for (int i = 1; i <= n; i++) scanf("%d", &b[i]);
  double L = 0, R = 1e9 + 7;
  double ans = -1;
  while (R - L > eps) {
    double mid = (L + R) / 2;
    if (mid == 0) break;
    if (check(mid)) {
      ans = mid;
      R = mid;
    } else
      L = mid;
  }
  if (ans == -1) {
    printf("-1\n");
  } else
    printf("%.7lf", ans);
}
