#include <bits/stdc++.h>
using namespace std;
const int MOD = 1000000007;
const int N = 2000100;

int fac[N], inv[N];
int powi(int a, int b) {int c = 1; for (; b; b >>= 1, a = 1ll * a * a % MOD) if (b & 1) c = 1ll * c * a % MOD; return c;}
int C(int n, int m) {return 1ll * fac[n + m] * inv[n] % MOD * inv[m] % MOD;}
int G(int x1, int y1, int x2, int y2)
{
    return (0ll + MOD + MOD + C(x2 + 1, y2 + 1) - C(x2 + 1, y1) - C(x1, y2 + 1) + C(x1, y1)) % MOD;
}
int ans;
int main()
{
    int x1, x2, x3, x4, x5, x6;
    int y1, y2, y3, y4, y5, y6;
    cin >> x1 >> x2 >> x3 >> x4 >> x5 >> x6;
    cin >> y1 >> y2 >> y3 >> y4 >> y5 >> y6;
    fac[0] = 1; for (int i = 1; i < N; ++ i) fac[i] = 1ll * fac[i - 1] * i % MOD;
    inv[N - 1] = powi(fac[N - 1], MOD - 2);
    for (int i = N - 2; ~i; -- i) inv[i] = 1ll * inv[i + 1] * (i + 1) % MOD;
    for (int i = x3; i <= x4; ++ i)
    {
        ans = (1ll * (MOD + x3 - i) * G(x5 - i, y5 - y3, x6 - i, y6 - y3) % MOD
            * G(i - x2, y3 - 1 - y2, i - x1, y3 - 1 - y1) + ans) % MOD;
        ans = (1ll * (i - x3 + y4 - y3 + 1) * G(x5 - i, y5 - y4 - 1, x6 - i, y6 - y4 - 1) % MOD
            * G(i - x2, y4 - y2, i - x1, y4 - y1) + ans) % MOD;
    }
    for (int i = y3; i <= y4; ++ i)
    {
        ans = (1ll * (MOD + y3 - i) * G(x5 - x3, y5 - i, x6 - x3, y6 - i) % MOD
            * G(x3 - 1 - x2, i - y2, x3 - 1 - x1, i - y1) + ans) % MOD;
        ans = (1ll * (i - y3 + x4 - x3 + 1) * G(x5 - x4 - 1, y5 - i, x6 - x4 - 1, y6 - i) % MOD
            * G(x4 - x2, i - y2, x4 - x1, i - y1) + ans) % MOD;
    }
    cout << ans;
}
