#include <bits/stdc++.h>
using namespace std;
inline int getidx(const vector<int>& ar, int x) {
  return lower_bound(ar.begin(), ar.end(), x) - ar.begin();
}
inline long long GCD(long long a, long long b) {
  long long n;
  if (a < b) swap(a, b);
  while (b != 0) {
    n = a % b;
    a = b;
    b = n;
  }
  return a;
}
inline long long LCM(long long a, long long b) {
  if (a == 0 || b == 0) return GCD(a, b);
  return a / GCD(a, b) * b;
}
inline long long CEIL(long long n, long long d) {
  return n / d + (long long)(n % d != 0);
}
inline long long ROUND(long long n, long long d) {
  return n / d + (long long)((n % d) * 2 >= d);
}
inline long long POW(long long a, long long n) {
  if (n < 0) return 0;
  long long ret = 1;
  while (n) {
    if (n % 2) ret *= a;
    a = a * a;
    n /= 2;
  }
  return ret;
}
void debug_out() { cerr << endl; }
template <typename Head, typename... Tail>
void debug_out(Head H, Tail... T) {
  cerr << " " << to_string(H);
  debug_out(T...);
}
const double EPS = 1e-12;
const int MAXN = 1e3;
int n;
double m, l[MAXN], d[MAXN];
void input() {
  cin >> n >> m;
  for (int(i) = (0); (i) < (int)(n); ++(i)) cin >> l[i];
  for (int(i) = (0); (i) < (int)(n); ++(i)) cin >> d[i];
}
bool chk(double k) {
  double cur = k + m;
  cur -= cur / l[0];
  if (cur + EPS < m) return false;
  for (int(i) = (1); (i) < (int)(n); ++(i)) {
    cur -= cur / d[i];
    cur -= cur / l[i];
    if (cur + EPS < m) return false;
  }
  cur -= cur / d[0];
  if (cur + EPS < m) return false;
  return true;
}
int solve() {
  double lo = 0, hi = 1e9 + 1;
  for (int(loop) = (0); (loop) < (int)(1000); ++(loop)) {
    double mid = (lo + hi) / 2;
    if (chk(mid))
      hi = mid;
    else
      lo = mid;
  }
  cout.precision(12);
  if (hi >= 1e9 + 1)
    cout << -1 << '\n';
  else
    cout << hi << '\n';
  return 0;
}
void execute() { input(), solve(); }
int main(void) {
  cin.tie(0);
  ios_base::sync_with_stdio(false);
  execute();
  return 0;
}
