#define DEB
#include<bits/stdc++.h>
#define REP(i,m) for(int i=0;i<(m);++i)
#define REPN(i,m,in) for(int i=(in);i<(m);++i)
#define ALL(t) (t).begin(),(t).end()
#define CLR(a) memset((a),0,sizeof(a))
#define pb push_back
#define mp make_pair
#define fr first
#define sc second

using namespace std;


#ifdef DEB
#define dump(x)  cerr << #x << " = " << (x) << endl
#define prl cerr<<"called:"<< __LINE__<<endl
#define dumpR(x) cerr<<"\x1b[31m"<<#x<<" = " <<(x)<<"\x1b[39m"<<endl
#define dumpY(x) cerr<<"\x1b[33m"<<#x<<" = " <<(x)<<"\x1b[39m"<<endl
#define dumpG(x) cerr<<"\x1b[32m"<<#x<<" = " <<(x)<<"\x1b[39m"<<endl
template<class T> void debug(T a,T b){ for(;a!=b;++a) cerr<<*a<<' ';cerr<<endl;}
#else
#define dump(x) ;
#define dumpR(x) ;
#define dumpY(x) ;
#define dumpG(x) ;
#define prl ;
template<class T> void debug(T a,T b){ ;}
#endif

template<class T> void chmin(T& a,const T& b) { if(a>b) a=b; }
template<class T> void chmax(T& a,const T& b) { if(a<b) a=b; }

typedef long long int lint;
typedef pair<int,int> pi;

namespace std{
  template<class S,class T>
  ostream &operator <<(ostream& out,const pair<S,T>& a){
    out<<'('<<a.fr<<','<<a.sc<<')';
    return out;
  }
}
template<lint mod>
struct Int_{
  unsigned x;
  unsigned mpow(Int_ a,unsigned k){
    Int_ res=1;
    while(k){
      if(k&1) res=res*a;
      a=a*a;
      k>>=1;
    }
    return res.x;
  }
  unsigned inverse(Int_ a){
    return mpow(a,mod-2);
  }
  Int_(): x(0) { }
  Int_(long long sig) {
    int sigt=sig%mod;
    if(sigt<0) sigt+=mod;
    x=sigt;
  }
  unsigned get() const { return (unsigned)x; }

  Int_ &operator+=(Int_ that) { if((x += that.x) >= mod) x -= mod; return *this; }
  Int_ &operator-=(Int_ that) { if((x += mod - that.x) >= mod) x -= mod; return *this; }
  Int_ &operator*=(Int_ that) { x = (unsigned long long)x * that.x % mod; return *this; }
  Int_ &operator=(Int_ that) { x=that.x; return *this;}
  Int_ &operator/=(Int_ that) { x=(unsigned long long) x * inverse(that.x)%mod; return *this;}
  bool operator==(Int_ that) const { return x==that.x; }
  bool operator!=(Int_ that) const { return x!=that.x; }

  Int_ operator-() const { return Int_(0)-Int_(*this);}
  Int_ operator+(Int_ that) const { return Int_(*this) += that; }
  Int_ operator-(Int_ that) const { return Int_(*this) -= that; }
  Int_ operator*(Int_ that) const { return Int_(*this) *= that; }
  Int_ operator/(Int_ that) const { return Int_(*this) /= that; }
  Int_ inv(){
    return Int_(mpow(x,mod-2));
  }
};

namespace std{
  template<lint mod>
  ostream &operator <<(ostream& out,const Int_<mod>& a){
    out<<a.get();
    return out;
  }
  template<lint mod>
  istream &operator >>(istream& in,Int_<mod>& a){
    in>>a.x;
    return in;
  }
};

typedef Int_<1000000007> Int;

Int mpow(Int a,lint k){
  Int res=1;
  while(k){
    if(k&1) res=res*a;
    a=a*a;
    k>>=1;
  }
  return res;
}

const int M=2000002;
Int fact[M+2],invf[M+2];
void prep(){
  fact[0]=invf[0]=1;
  REP(i,M){
    fact[i+1]=fact[i]*(i+1);
  }
  invf[M]=fact[M].inv();
  for(int i=M-1;i>=0;--i) invf[i]=invf[i+1]*(i+1);
}
Int C(int a,int b){
  if(a<0 || b<0 || a<b) return 0;
  return fact[a]*invf[a-b]*invf[b];
}

Int mix(int a,int b){
  return C(a+b,a);
}
vector<int> X(6),Y(6);
//
//Int solveTwoLine(int w1,int g,int w2,int h){
//  assert(g>=0);
//  assert(w1>=0 && w2>=0);
//  if(h<0) return 0;
//  if(h==0) return w1*(lint)w2;
//
//  pi ps[2][2]={
//          {{0,-1},{w1,-1}},
//          {{w1+g+w2-1,h+1},{w1+g-1,h+1}}
//  };
//  Int res=0;
//  REP(t,2) REP(t2,2) res+=mix(ps[1][t2].fr-ps[0][t].fr,ps[1][t2].sc-ps[0][t].sc)*(t==t2?1:-1);
//  return res;
//}
//Int solve(int x1,int x2,int x3,int x4,int y1,int y2,int y3,int y4){
//  int w1=x2-x1+1,dX=x3-x2,w2=x4-x3+1;
//  int h1=y2-y1+1,dY=y3-y2,h2=y4-y3+1;
//
//  pair<pi,int> lines[2][2]={
//          {{{x1-1,y1},w1},{{x1-1,y2+1},w1}},
//          {{{x3+1,y4},w2},{{x3+1,y3-1},w2}}
//  };
//
//  Int res=0;
//  REP(t,2) REP(t2,2) res+=solveTwoLine(lines[0][t].sc
//              ,lines[1][t2].fr.fr-lines[0][t].fr.fr-lines[0][t].sc
//              ,lines[1][t2].sc,lines[1][t2].fr.sc-lines[0][t].fr.sc)*(t==t2?1:-1);
//  return res;
//}
int main(){
#ifdef LOCAL_REDIR
  freopen("/home/hog/Dropbox/pg/working/in.txt","r",stdin);
#endif
  prep();
  REP(i,6) cin>>X[i];
  REP(i,6) cin>>Y[i];

  int xs1[2]={X[0]-1,X[1]};
  int ys1[2]={Y[0]-1,Y[1]};

  int xs2[2]={X[4],X[5]+1};
  int ys2[2]={Y[4],Y[5]+1};

  Int ans=0;

  REP(t,4) REP(t2,4){
      Int coef=(__builtin_popcount(t^t2)&1)?(-1):1;

      Int tmp=0;
      int x1=xs1[t&1],y1=ys1[t>>1&1];
      int x2=xs2[t2&1],y2=ys2[t2>>1&1];
      int h=Y[3]-Y[2]+1,w=X[3]-X[2]+1;
      for(int x=X[2];x<=X[3];++x){
        int y=Y[2];
        tmp+=mix(x-x1,y-y1-1)*mix(x2-x,y2-y)*(X[2]-x-1);
      }
      for(int x=X[2];x<=X[3];++x){
        int y=Y[3];
        tmp+=mix(x-x1,y-y1)*mix(x2-x,y2-y-1)*(x-X[2]+h+1);
      }
      for(int y=Y[2];y<=Y[3];++y){
        int x=X[2];
        tmp+=mix(x-x1-1,y-y1)*mix(x2-x,y2-y)*(Y[2]-y-1);
      }
      for(int y=Y[2];y<=Y[3];++y){
        int x=X[3];
        tmp+=mix(x-x1,y-y1)*mix(x2-x-1,y2-y)*(y-Y[2]+w+1);
      }
      ans+=tmp*coef;
    }

  cout<<ans<<endl;
  return 0;
}






Measured memory_bytes: 15872