#include <bits/stdc++.h>

#define FAST ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
using namespace std;
using ll = long long;

bool solve(vector<ll> a) {
    int n, i, mn;
    n = a.size();

    if (a[0] == -1) return 0;
    if (a[n-1] == -1) return 0;

    swap(a[1], a[2]);

    for (i = 1; i < n; ++i) {
        mn = min(a[i-1], a[i]);
        a[i-1] -= mn;
        a[i] -= mn;
    }

    for (i = 0; i < n; ++i) {
        if (a[i]) return 0;
    }

    return 1;
}

bool check(vector<ll>& a) {
    int n, i, j, x, y;
    n = a.size()-1;

    vector<ll> pre(n+2, -1), suff(n+2, -1);
    pre[0] = suff[n+1] = 0;

    for (i = 1; i <= n; ++i) {
        if (a[i] < pre[i-1]) break;
        pre[i] = a[i]-pre[i-1];
    }
    if (!pre[i-1]) return 1;

    for (i = n; i > 0; --i) {
        if (a[i] < suff[i+1]) break;
        suff[i] = a[i]-suff[i+1];
    }
    if (!suff[i+1]) return 1;

    for (i = 1; i < n; ++i) {
        if (solve({pre[i-1], a[i], a[i+1], suff[i+2]})) return 1;
    }

    return 0;
}

int main() {
    FAST;

    int tc, ti = 1;
    cin >> tc;

    while (tc--) {
        int n, i;
        cin >> n;

        vector<ll> a(n+1);
        for (i = 1; i <= n; ++i) cin >> a[i];

        cout << (check(a) ? "YES" : "NO") << "\n";
    }

    return 0;
}
