#include <bits/stdc++.h>
using namespace std;
long long solve(int x) {
  int i, j, k;
  long long sum = 0;
  for (i = 0; i <= x; i++) {
    for (j = 0; i + j <= x; j++) {
    }
  }
}
long long fsum(long long a, long long b, long long c) {
  long long ans = 0;
  while (b) {
    if (b % 2 == 1) {
      ans = (ans + a) % c;
    }
    a = (a + a) % c;
    b = b / 2;
  }
  return ans;
}
long long f(long long a, long long b, long long c) {
  long long ans = 1;
  a = a % c;
  while (b) {
    if (b % 2 == 1) {
      ans = (ans * a) % c;
    }
    a = (a * a) % c;
    b = b / 2;
  }
  return ans;
}
long long gcd(long long x, long long y) {
  if (x < y) {
    swap(x, y);
  }
  while (y) {
    long long a = x % y;
    x = y;
    y = a;
  }
  return x;
}
int a[1005];
int b[1005];
int vis[1005];
map<int, int> mp;
map<int, int>::iterator it;
int main() {
  int n, m, i;
  cin >> n >> m;
  memset(vis, 0, sizeof(vis));
  memset(a, 0, sizeof(a));
  memset(b, 0, sizeof(b));
  int f = 0;
  for (i = 1; i <= n; i++) {
    cin >> a[i];
    if (a[i] <= 1) {
      f = 1;
    }
  }
  for (i = 1; i <= n; i++) {
    cin >> b[i];
    if (b[i] <= 1) {
      f = 1;
    }
  }
  if (f == 1) {
    printf("-1\n");
  } else {
    double ans = m * b[1] * 1.0 / (b[1] - 1);
    int flag = 0;
    int j = n;
    while (j >= 2) {
      ans = ans * a[j] * 1.0 / (a[j] - 1);
      ans = ans * b[j] * 1.0 / (b[j] - 1);
      j--;
    }
    ans = ans * a[1] * 1.0 / (a[1] - 1);
    ans = ans - m;
    printf("%.10lf\n", ans);
  }
  return 0;
}
