#include <bits/stdc++.h>
using namespace std;
void solve() {
  int n;
  cin >> n;
  int m;
  cin >> m;
  vector<int> a(n), b(n);
  for (int i = 0; i < n; i++) cin >> a[i];
  for (int i = 0; i < n; i++) cin >> b[i];
  vector<int> v;
  v.push_back(a[0]);
  for (int i = 1; i < n; i++) {
    v.push_back(b[i]);
    v.push_back(a[i]);
  }
  v.push_back(b[0]);
  for (auto i : v) {
    if (i == 1) {
      cout << -1 << "\n";
      return;
    }
  }
  double ans = 0;
  for (int i = v.size() - 1; ~i; i--) {
    ans += (m + ans + 0.0) / (v[i] - 1);
  }
  cout << fixed << setprecision(10);
  ;
  cout << ans << "\n";
}
int main() {
  solve();
  return 0;
}
