#include <bits/stdc++.h>
using namespace std;
int oo = (1e9) + 7;
long long oo2 = 1ll * oo * oo;
vector<int> custo_partida(1005);
vector<int> custo_chegada(1005);
int n, m;
bool check(double mid) {
  double comb = mid;
  double w = m + comb;
  comb -= w / custo_partida[0];
  w = m + comb;
  if (comb <= 0.0) return false;
  for (int i = 1; i < n; ++i) {
    comb -= w / custo_partida[i];
    w = m + comb;
    if (comb <= 0.0) return false;
    comb -= w / custo_chegada[i];
    w = m + comb;
    if (comb <= 0.0) return false;
  }
  comb -= w / custo_chegada[0];
  if (comb <= 0.0) return false;
  return true;
}
int main() {
  scanf("%d %d", &n, &m);
  for (int i = 0; i < n; ++i) {
    int x;
    scanf("%d", &x);
    custo_partida[i] = x;
  }
  for (int i = 0; i < n; ++i) {
    int x;
    scanf("%d", &x);
    custo_chegada[i] = x;
  }
  double l = 0;
  double r = 1e10;
  for (int i = 0; i < 400; ++i) {
    double mid = (l + r) / 2;
    if (check(mid))
      r = mid;
    else
      l = mid;
  }
  if (l >= 1e9 + 5)
    printf("-1\n");
  else
    printf("%.15lf\n", l);
}
