-- Question E yametoke.

import Control.Applicative
import Control.Monad

main = do
  [x1,x2,x3,x4,x5,x6] <- map read . words <$> getLine
  [y1,y2,y3,y4,y5,y6] <- map read . words <$> getLine
  putStrLn $ show(check x1 x2 x3 x4 x5 x6 y1 y2 y3 y4 y5 y6)
  
check x1 x2 x3 x4 x5 x6 y1 y2 y3 y4 y5 y6 = (pqst x1 x2 y1 y2 x3 x4 y3 y4) * (uvst x3 x4 y3 y4 x5 x6 y5 y6) `mod` (10^9+7)
  
--pのみ動かす
pmove x1 x2 q s t = sum[ comp (s+t-p-q) (s-p) | p <-[x1..x2]] `mod` (10^9+7)
  
--それをqのみ動かす

pqmove x1 x2 y1 y2 s t = sum[ (pmove x1 x2 q s t) | q <-[y1..y2]] `mod` (10^9+7)

--それをsで動かす

pqsmove x1 x2 y1 y2 x3 x4 t = sum[ (pqmove x1 x2 y1 y2 s t) | s <-[x3..x4]] `mod` (10^9+7)

--それをｔで動かす
pqst x1 x2 y1 y2 x3 x4 y3 y4 = sum[ (pqsmove x1 x2 y1 y2 x3 x4 t) | t <-[y3..y4]] `mod` (10^9+7)

--sのみ動かす
smove x3 x4 t u v = sum[ comp (u+v-s-t) (u-s) | s <-[x3..x4]] `mod` (10^9+7)
  
--tのみ動かす
stmove x3 x4 y3 y4 u v = sum[ smove x3 x4 t u v | t <-[y3..y4]] `mod` (10^9+7)
  
--uのみ動かす
stumove x3 x4 y3 y4 x5 x6 v = sum[ stmove x3 x4 y3 y4 u v | u <-[x5..x6]] `mod` (10^9+7) 
  
--vのみ動かす
uvst x3 x4 y3 y4 x5 x6 y5 y6 = sum[ stumove x3 x4 y3 y4 x5 x6 v | v <-[y5..y6]] `mod` (10^9+7)  
  
  
  
comp n k = (n^>k `div` k^>k) `mod` (10^9+7) 
    where
        n^>k = foldr (*) 1 [n-k+1..n]  
