#include <bits/stdc++.h>
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
using namespace std;
long long gcd(long long a, long long b) { return (a == 0) ? b : gcd(b % a, a); }
long long cnt1(long long x) {
  long long cnt = 0;
  while (x > 0) x &= x - 1, cnt++;
  return cnt;
}
long long fact(long long n) { return n == 0 ? 1LL : n * fact(n - 1); }
long long fact(long long n, long long p) {
  return n == 0 ? 1LL : n * fact(n - 1) % p;
}
long long cnk(long long n, long long k) {
  return n == 1 || k == 1 ? 1 : cnk(n - 1, k) + cnk(n - 1, k - 1);
}
long long pow(long long a, long long n, long long p) {
  if (n == 0) return 1;
  long long t = pow(a, n / 2, p);
  return t * t * (n % 2 ? a : 1);
}
long long cnk(long long n, long long k, long long p) {
  return fact(n, p) * pow(fact(k, p), p - 2, p) * pow(fact(n - k, p), p - 2, p);
}
template <class T>
istream &operator>>(istream &is, vector<T> &v) {
  for (long long i = 0; i < v.size(); i++) is >> v[i];
  return is;
}
template <class T>
ostream &operator<<(ostream &os, vector<T> v) {
  for (long long i = 0; i < v.size(); i++) os << v[i] << ' ';
  os << '\n';
  return os;
}
const long double EPS = 1e-6;
long long n, m;
vector<long long> a, b;
bool can(long double x) {
  x += m;
  for (long long i = 0; i < n; i++) {
    x -= x / a[i];
    long long j = i == n - 1 ? 0 : i + 1;
    x -= x / b[j];
  }
  return x >= m;
}
signed main() {
  ios_base::sync_with_stdio(0), cin.tie(0);
  cin >> n >> m;
  a.resize(n);
  b.resize(n);
  cin >> a >> b;
  const long long INF = 1e+9 + 2;
  long double l = 0, r = INF;
  while (r - l > EPS) {
    long double mid = (r + l) / 2;
    if (can(mid))
      r = mid;
    else
      l = mid;
  }
  if (abs(l - INF) < EPS)
    cout << -1;
  else
    cout << fixed << setprecision(6) << l;
}
