#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
  int n, m;
  cin >> n >> m;
  vector<int> a(n);
  vector<int> b(n);
  long double mass = m;
  for (int i = 0; i < (n); ++i) {
    cin >> a[i];
    if (a[i] == 1) {
      cout << -1;
      return 0;
    }
  }
  for (int i = 0; i < (n); ++i) {
    cin >> b[i];
    if (b[i] == 1) {
      cout << -1;
      return 0;
    }
  }
  mass += mass / (b[0] - 1);
  for (int i = n - 1; i >= 1; --i) {
    mass += mass / (a[i] - 1);
    mass += mass / (b[i] - 1);
  }
  mass += mass / (a[0] - 1);
  cout << setprecision(numeric_limits<long double>::max_digits10) << mass - m;
}
