import java.util.*;
import java.lang.*;
import java.math.*;
import java.io.*;

/* spar5h */

public class cf1 implements Runnable{    
	
	public void run() {

		InputReader s = new InputReader(System.in);
		PrintWriter w = new PrintWriter(System.out);
		
		int t = 1;
		
		while(t-- > 0) {
			
			int n = s.nextInt(), m = s.nextInt();
			
			int[] a = new int[n + 1];
			
			for(int i = 1; i <= n; i++)
				a[i] = s.nextInt();
			
			int[] b = new int[n + 1];
			
			for(int i = 1; i <= n; i++)
				b[i] = s.nextInt();
			
			ArrayList<Integer> list = new ArrayList<Integer>();
			
			list.add(a[1]);
			
			for(int i = 2; i <= n; i++) {
				list.add(b[i]); list.add(a[i]);
			}
			
			list.add(b[1]);
			
			double wt = m;
			boolean check = true;
			
			for(int i = list.size() - 1; i >= 0; i--) {
				
				if(list.get(i) <= 1) {
					check = false; break;
				}
				
				double x = wt / (list.get(i) - 1);
						
				wt += x;
			}
			
			if(check)
				w.println(wt - m);
			else
				w.println(-1);
		}
		
		w.close();
	}
	
	static class InputReader {
		
		private InputStream stream;
		private byte[] buf = new byte[1024];
		private int curChar;
		private int numChars;
		private SpaceCharFilter filter;
		
		public InputReader(InputStream stream)
		{
			this.stream = stream;
		}
		
		public int read()
		{
			if (numChars==-1) 
				throw new InputMismatchException();
			
			if (curChar >= numChars)
			{
				curChar = 0;
				try 
				{
					numChars = stream.read(buf);
				}
				catch (IOException e)
				{
					throw new InputMismatchException();
				}
				
				if(numChars <= 0)				
					return -1;
			}
			return buf[curChar++];
		}
	 
		public String nextLine()
		{
			BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
			String str = "";
            try
            {
                str = br.readLine();
            }
            catch (IOException e)
            {
                e.printStackTrace();
            }
            return str;
		}
		public int nextInt()
		{
			int c =... What is the time complexity of the previous code?