#include <bits/stdc++.h>

using namespace std;
typedef long long ll;

#define inf 1e16
const int mxn = 2e5+5;

bool check(vector<ll>v)
{
    for(int i = 0; i+1<v.size(); i++) {
        if(v[i]>v[i+1]) {
            return 0;
        }
        v[i+1]-=v[i];
        v[i] = 0;
    }
    if(v.back()) return 0;
    return 1;
}

void solve()
{
    int n;
    scanf("%d", &n);
    vector<ll>arr(n);
    for(int i = 0; i < n; i++) {
        scanf("%lld", &arr[i]);
    }
    if(n==1) {
        printf("NO\n");
        return;
    }
    if(check(arr)) {
        printf("YES\n");
        return;
    }
    swap(arr[0], arr[1]);
    if(check(arr)) {
        printf("YES\n");
        return;
    }
    swap(arr[0], arr[1]);
    swap(arr[n-1], arr[n-2]);
    if(check(arr)) {
        printf("YES\n");
        return;
    }
    swap(arr[n-1], arr[n-2]);
    vector<ll>pre(n), suf(n), tmp(n);
    tmp = arr;
    pre[0] = arr[0];
    for(int i = 1; i < n; i++) {
        if(pre[i-1]==-1 || tmp[i-1]>tmp[i]) {
            pre[i] = -1;
        }
        else {
            tmp[i]-=tmp[i-1];
            tmp[i-1] = 0;
            pre[i] = tmp[i]; 
        }
    }
    tmp = arr;
    suf[n-1] = arr[n-1];
    for(int i = n-2; i >= 0; i--) {
        if(suf[i+1]==-1 || tmp[i+1]>tmp[i]) {
            suf[i] = -1;
        }
        else {
            tmp[i]-=tmp[i+1];
            tmp[i+1] = 0;
            suf[i] = tmp[i];
        }
    }
    for(int i = 1; i+2 < n; i++) {
        if(pre[i-1]==-1 || suf[i+2]==-1) continue;
        vector<ll>c = {pre[i-1], arr[i], arr[i+1], suf[i+2]};
        swap(c[1], c[2]);
        if(check(c)) {
            printf("YES\n");
            return;
        }
    }
    printf("NO\n");
    return;
}   
int main()
{
    int T;
    scanf("%d", &T);

    while(T--) {
        solve();
    }
    return 0;
}