#include <bits/stdc++.h>
using namespace std;
int n, m;
vector<int> a, b;
bool func(const long double x) {
  long double weight = m + x;
  for (int i = 0, j = 1; i < n; i++) {
    weight -= (weight / a[i]);
    weight -= (weight / b[j]);
    j++;
    if (j == n) j = 0;
  }
  return weight >= m;
}
void solve() {
  cin >> n >> m;
  a.resize(n), b.resize(n);
  bool tmp = true;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    if (a[i] == 1) tmp = false;
  }
  for (int i = 0; i < n; i++) {
    cin >> b[i];
    if (b[i] == 1) tmp = false;
  }
  if (!tmp) {
    puts("-1");
    return;
  }
  long double l = 0, r = 1e9;
  for (int i = 1; i <= 256; i++) {
    long double mid = (l + r) * .5;
    if (func(mid)) {
      r = mid;
    } else {
      l = mid;
    }
  }
  cout << setprecision(16) << r << endl;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
