#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) { return b == 0 ? a : gcd(b, a % b); }
int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  double weight = m;
  int a[n], b[n];
  int arr[n * 2];
  for (int i = 0; i < n; i++) {
    scanf("%d", &a[i]);
    if (a[i] <= 1) {
      cout << "-1";
      return 0;
    }
  }
  for (int i = 0; i < n; i++) {
    scanf("%d", &b[i]);
    if (b[i] <= 1) {
      cout << "-1";
      return 0;
    }
  }
  arr[0] = a[0];
  arr[n * 2 - 1] = b[0];
  int j = 1;
  for (int i = 1; i < n * 2 - 1; i += 2) {
    arr[i] = b[j];
    arr[i + 1] = a[j];
    j++;
  }
  for (int i = n * 2 - 1; i >= 0; i--) {
    double x;
    x = weight / ((arr[i] - 1) * 1.0);
    weight += x;
  }
  printf("%.12f", weight - m);
  return 0;
}
