#include <bits/stdc++.h>
using namespace std;
long long int recpow(long long int x, long long int n) {
  if (n == 0)
    return 1;
  else if (n % 2 == 0)
    return recpow((x * x) % 1000000007, n / 2);
  else
    return (x * recpow((x * x) % 1000000007, (n - 1) / 2)) % 1000000007;
}
bool sortbysec(
    const pair<pair<long long int, long long int>, long long int> &a,
    const pair<pair<long long int, long long int>, long long int> &b) {
  if (a.second == b.second)
    return (a.first.second < b.first.second);
  else
    return (a.second > b.second);
}
string rev(string s) {
  string t;
  for (long long int i = s.length() - 1; i >= 0; i--) {
    t.push_back(s[i]);
  }
  return t;
}
bool comp(pair<long long int, long long int> a,
          pair<long long int, long long int> b) {
  if (a.first == b.first)
    return a.second < b.second;
  else
    return a.first < b.first;
}
vector<long long int> v;
bool ispos(long long int c, long long int n) {
  long long int s = 0;
  for (long long int i = 0; i < v.size(); i++) {
    s += v[i] / c;
    if (s >= n) {
      return true;
    }
  }
  return false;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long int n;
  double m, x;
  cin >> n >> m;
  x = m;
  double a[n], b[n];
  for (long long int i = 0; i < n; i++) cin >> a[i];
  for (long long int i = 0; i < n; i++) cin >> b[i];
  for (long long int i = 0; i < n; i++) {
    if (a[i] == 1 || b[i] == 1) {
      cout << -1;
      return 0;
    }
  }
  double f = m / (b[0] - 1);
  m += f;
  for (long long int i = n - 1; i >= 1; i--) {
    f = m / (a[i] - 1);
    m += f;
    f = m / (b[i] - 1);
    m += f;
  }
  f = m / (a[0] - 1);
  m += f;
  double ans = m - x;
  cout << setprecision(10);
  cout << fixed << ans << "\n";
  return 0;
}
