#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  double m;
  cin >> n >> m;
  double a[n + 5], b[n + 5];
  int flag = 1;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    if (a[i] <= 1) flag = 0;
  }
  for (int i = 0; i < n; i++) {
    cin >> b[i];
    if (b[i] <= 1) flag = 0;
  }
  if (flag == 0) {
    cout << "-1" << endl;
    return 0;
  }
  double second = m;
  int i = n - 1;
  second += second / (b[0] - 1);
  while (i > 0) {
    second += second / (a[i] - 1);
    second += second / (b[i--] - 1);
  }
  second += second / (a[0] - 1);
  printf("%.10lf\n", second - m);
  return 0;
}
