#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int n, m;
  cin >> n >> m;
  int a[n + 1];
  int b[n + 1];
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
    if (a[i] == 1) {
      cout << -1;
      return 0;
    }
  }
  for (int i = 1; i <= n; i++) {
    cin >> b[i];
    if (b[i] == 1) {
      cout << -1;
      return 0;
    }
  }
  double f = (double)(m / (double)(b[1] - 1));
  double w = (double)(m + f);
  double mf;
  for (int i = n; i > 1; i--) {
    mf = (double)(w / (double)(a[i] - 1));
    f += mf;
    w += mf;
    mf = (double)(w / (double)(b[i] - 1));
    f += mf;
    w += mf;
  }
  f += (double)(w / (double)(a[1] - 1));
  printf("%.10f", f);
  return 0;
}
