#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  int a[n], b[n], flag = 0;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    if (a[i] == 1) flag = 1;
  }
  for (int i = 0; i < n; i++) {
    cin >> b[i];
    if (b[i] == 1) flag = 1;
  }
  if (flag)
    cout << "-1\n";
  else {
    float ans = 1;
    for (int i = 0; i < n; i++) {
      ans = ans * (a[i] - 1) / a[i];
      ans = ans * (b[i] - 1) / b[i];
    }
    ans = m / ans;
    cout << fixed << setprecision(10);
    cout << ans - m << endl;
  }
}
