#include <bits/stdc++.h>
using namespace std;
int n, m;
vector<int> a, b;
bool cando(double fuel) {
  for (int i = 0; i < n; i++) {
    fuel -= (m + fuel) / a[i];
    if (fuel < 0) return false;
    fuel -= (m + fuel) / b[i];
    if (fuel < 0) return false;
  }
  return true;
}
int main(int argc, char** argv) {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  if (argc == 2 && atoi(argv[1]) == 123456789)
    freopen("d:\\code\\cpp\\stdin", "r", stdin);
  cin >> n >> m;
  a.resize(n);
  b.resize(n);
  for (int i = 0; i < n; i++) cin >> a[i];
  for (int i = 0; i < n; i++) cin >> b[i];
  bool found = false;
  double sol = 1e9 + 7;
  double left = 0, right = 1e9;
  int k = 0;
  while (abs(right - left) > 1e-8 && k < 60) {
    double c = (right + left) * 0.5;
    if (cando(c)) {
      found = true;
      sol = min(sol, c);
      right = c;
    } else
      left = c;
    k++;
  }
  if (found)
    printf("%.15f\n", sol);
  else
    printf("-1\n");
  return 0;
}
