#include <bits/stdc++.h>
using namespace std;
using lint = long long int;
#define FOR(i, begin, end) for(int i=(begin);i<(end);i++)
#define IFOR(i, begin, end) for(int i=(end)-1;i>=(begin);i--)
#define REP(i, n) FOR(i,0,n)
#define IREP(i, n) IFOR(i,0,n)

constexpr lint MOD = 1000000007;
template <int mod>
struct ModInt
{
    using lint = long long;
    int val;
    ModInt() : val(0) {}
    void _setval(lint v) { v = (v % mod) + mod; val = v >= mod ? v - mod : v; }
    ModInt(lint v) { _setval(v); }
    ModInt operator+(const ModInt &x) const { return ModInt((lint)val + x.val); }
    ModInt operator-(const ModInt &x) const { return ModInt((lint)val - x.val); }
    ModInt operator*(const ModInt &x) const { return ModInt((lint)val * x.val); }
    ModInt operator/(const ModInt &x) const { return ModInt((lint)val * x.inv().val); }
    ModInt operator-() const { return ModInt(-val); }
    ModInt &operator+=(const ModInt &x) { return *this = *this + x; }
    ModInt &operator-=(const ModInt &x) { return *this = *this - x; }
    ModInt &operator*=(const ModInt &x) { return *this = *this * x; }
    ModInt &operator/=(const ModInt &x) { return *this = *this / x; }
    bool operator==(const ModInt &x) { return val == x.val; }
    bool operator!=(const ModInt &x) { return val != x.val; }
    friend ostream &operator<<(ostream &os, const ModInt &x) { os << x.val;  return os; }

    lint power(lint n) const {
        ModInt ans(1), tmp(val);
        while (n) {
            if (n & 1) ans *= tmp;
            tmp *= tmp;
            n /= 2;
        }
        return ans.val;
    }
    ModInt inv() const { return this->power(mod - 2); }
    
    ModInt fac() const {
        static vector<ModInt> facs;
        int l0 = facs.size();
        if (l0 > this->val) return facs[this->val];

        facs.resize(this->val + 1);
        for (int i = l0; i <= this->val; i++) facs[i] = (i == 0 ? 1 : facs[i - 1] * i);
        return facs[this->val];
    }

    ModInt nCr(const ModInt &r) const {
        if (this->val < r.val) return ModInt(0);
        return this->fac() / ((*this - r).fac() * r.fac());
    }
};
using mint = ModInt<MOD>;

vector<lint> fac, facInv, inv;
void facInit(int nmax)
{
    fac = facInv = inv = vector<lint>(nmax + 1, 1);
    for (int i = 2; i <= nmax; i++)
    {
        fac[i] = fac[i-1] * i % MOD;
        inv[i] = MOD - inv[MOD%i] * (MOD/i) % MOD;
        facInv[i] = facInv[i-1] * inv[i] % MOD;
    }
}
lint nCr(int n, int r)
{
    if (n<r || r<0) return 0;
    return (fac[n] * facInv[r] % MOD) * facInv[n-r] % MOD;
}

int x[7], y[7];

mint solve2(int W, int H, int A, int B)
{
    mint ans(0);
    REP(w, A + 1) if (W + H - B - w - 1 >= 0) ans += nCr(B + w, w) * nCr(W + H - B - w - 1, W - w) % MOD * (B + w + 1);
    REP(h, B + 1) if (W + H - A - h - 1 >= 0) ans += nCr(A + h, h) * nCr(W + H - A - h - 1, H - h) % MOD * (A + h + 1);
    return ans;
}

mint solve(int xs, int xt, int ys, int yt, int w, int h)
{
    mint ans = 0;
    ans += solve2(xs + xt + w, ys + yt + h, xs + w, ys + h);
    ans -= solve2(xs + xt + w, ys + yt + h, xs - 1, ys + h);
    ans += solve2(xs + xt + w, ys + yt + h, xs - 1, ys - 1);
    ans -= solve2(xs + xt + w, ys + yt + h, xs + w, ys - 1);
    return ans;
}

int main()
{
    REP(i, 6) cin >> x[i + 1];
    REP(i, 6) cin >> y[i + 1];
    int w = x[4] - x[3];
    int h = y[4] - y[3];
    facInit(x[6] + y[6]);

    mint ans(0);
    REP(S, 1<<4) {
        int sign = 1;
        int xs = x[3] - x[2];
        int xt = x[5] - x[4];
        int ys = y[3] - y[2];
        int yt = y[5] - y[4];
        if (S >> 0 & 1) xs = x[3] - x[1] + 1, sign *= -1;
        if (S >> 1 & 1) xt = x[6] - x[4] + 1, sign *= -1;
        if (S >> 2 & 1) ys = y[3] - y[1] + 1, sign *= -1;
        if (S >> 3 & 1) yt = y[6] - y[4] + 1, sign *= -1;
        ans += solve(xs, xt, ys, yt, w, h) * sign;
    }
    cout << ans << endl;
}


Measured memory_bytes: 47104