#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0), cout.tie(0);
  int n;
  cin >> n;
  int m;
  cin >> m;
  double a[1001], b[1001];
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    if (a[i] == 1) {
      cout << -1 << endl;
      return 0;
    }
  }
  for (int i = 0; i < n; i++) {
    cin >> b[i];
    if (b[i] == 1) {
      cout << -1 << endl;
      return 0;
    }
  }
  double k = m / (b[0] - 1);
  if (k > (1e9)) {
    cout << -1;
    return 0;
  }
  for (int i = n - 1; i > 0; i--) {
    k = (k * a[i] + m) / (a[i] - 1);
    if (k > (1e9 + 1000)) {
      cout << -1;
      return 0;
    }
    k = (k * b[i] + m) / (b[i] - 1);
    if (k > (1e9 + 1000)) {
      cout << -1;
      return 0;
    }
  }
  k = (k * a[0] + m) / (a[0] - 1);
  if (k > (1e9 + 1000)) {
    cout << -1;
    return 0;
  }
  cout << fixed << setprecision(100) << k;
  return 0;
}
