#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  scanf("%d", &n);
  int m;
  scanf("%d", &m);
  int a[1005];
  for (int i = 0; i < n; i++) scanf("%d", &a[i]);
  int b[1005];
  for (int i = 0; i < n; i++) scanf("%d", &b[i]);
  double Max = 2e9, Min = 0;
  while ((Max - Min) / Max > 1e-7) {
    double mid = (Max + Min) / 2;
    double now = mid + m, fuel = mid;
    for (int i = 0; i < n; i++) {
      double need = now / a[i];
      now -= need;
      fuel -= need;
      need = now / b[(i + 1) % n];
      now -= need;
      fuel -= need;
      if (fuel < 0) break;
    }
    if (fuel < 0) {
      Min = mid;
    } else {
      Max = mid;
    }
  }
  if (Min > 1e9)
    printf("-1\n");
  else
    printf("%.12lf\n", Min);
}
