/* Vineeth Kada
 * 21/01/2021 - 11:11:15 */

#include<bits/stdc++.h>
using namespace std;

// #define int long long
typedef unsigned long long ull;
typedef long long ll;
typedef vector<int> vi;
typedef pair<int,int> pi;

#define F first
#define S second
#define PB push_back
#define rep(i,a,b) for(int i=a; i<=b; i++)
#define inf(dtype) numeric_limits<dtype>::max()
#define ninf(dtype) numeric_limits<dtype>::min()

int Solve(){
    // Dont forget to scan input variables like n, m, k
    int n; cin >> n;
    int a[n];
    rep(i,0,n-1) cin >> a[i];
    int p[n];
    p[0] = a[0];
    int poss = 1;
    rep(i,1,n-1){
        if(poss && a[i] - p[i-1]>=0) p[i] = a[i] - p[i-1];
        else {p[i] = -1; poss = 0;}
    }
    int s[n]; s[n-1] = a[n-1];
    poss = 1;
    for(int i=n-2; i>=0; i--){
        if(poss && a[i] - s[i+1]>=0) s[i] = a[i] - s[i+1];
        else {s[i] = -1; poss = 0;}
    }
    // for(int &x: p) cout << x << " ";
    // cout  << endl;
    // for(int &x: s) cout << x << " ";
    // cout  << endl;
    if(p[n-1] == 0) return 1;
    rep(i,0,n-2){
        if((i-1>=0 && p[i-1] == -1) || (i+2 <= n-1 && s[i+2] == -1)) continue;
        int d1 = a[i+1] - (i>=1 ? p[i-1] : 0);
        int d2 = a[i] - d1;
        int d3 = (i+2 <= n-1 ? s[i+2] : 0) - d2;
        if(d1 >= 0 && d2 >= 0 && d3 >= 0){
            if(d3 == 0){
                return 1;
            }
            else continue;
        }
    }
    return 0;
}

int32_t main(){
    ios_base::sync_with_stdio(false), cin.tie(NULL);
    int t = 1;
    cin >> t;
    while(t--){
        if(Solve()) cout << "YES" << endl;
        else cout << "NO" << endl;
    }
    return 0;
}
