#include <bits/stdc++.h>
using namespace std;
long long n, i, j, k, m, h, r, c;
long long x, y;
void solve() {
  double m;
  cin >> n >> m;
  long long a[n], b[n];
  for (i = 0; i < n; i++) {
    cin >> a[i];
    if (a[i] <= 1) c = 1;
  }
  for (i = 0; i < n; i++) {
    cin >> b[i];
    if (b[i] <= 1) c = 1;
  }
  if (c == 1) {
    cout << "-1";
    return;
  }
  double c1;
  long long fuel;
  double cur = m;
  c1 = (cur) / (b[0] - 1);
  cur += c1;
  for (i = n - 1; i >= 1; i--) {
    c1 = cur / (a[i] - 1);
    cur += c1;
    c1 = cur / (b[i] - 1);
    cur += c1;
  }
  c1 = cur / (a[0] - 1);
  cur += c1;
  cout << fixed << setprecision(10) << cur - m;
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  ;
  long long int T = 1;
  long long h = T;
  while (T--) {
    solve();
    cout << endl;
  }
  return 0;
}
