#include <bits/stdc++.h>
#define debug(x) cerr << #x << " = " << x << endl
using namespace std;
typedef long long LL;
const int N = 400005;
int a[N], b[N], n;
vector<int> vec;

int main()
{
    int T; scanf("%d", &T);
    while(T--) {
        vec.clear();
        scanf("%d", &n);
        for(int i = 1; i <= n; i++) scanf("%d", &a[i]);

        //1
        for(int i = 1; i <= n; i++) b[i] = a[i];
        int pos = -1;
        for(int i = 2; i <= n; i++) {
            b[i] = b[i] - b[i - 1];
            b[i - 1] -= b[i - 1];
            if(b[i] < 0) {
                pos = i;
                break;
            }
        }
        if(b[n]) {
            if(pos == -1) pos = n;
        }
        if(pos == -1) {
            puts("YES");
            continue;
        }
        if(pos > 0) {
            vec.push_back(pos);
            for(int id = 1; id <= 10; id++) {
                vec.push_back(pos - id);
                vec.push_back(pos + id);
            }
        }

        //2
        pos = -1;
        for(int i = 1; i <= n; i++) b[i] = a[i];
        for(int i = n - 1; i >= 1; i--) {
            b[i] = b[i] - b[i + 1];
            b[i + 1] -= b[i + 1];
            if(b[i] < 0) {
                pos = i;
                break;
            }
        }
        if(b[1]) {
            if(pos == -1) pos = 1;
        }
        if(pos > 0) {
            vec.push_back(pos);
            for(int id = 1; id <= 10; id++) {
                vec.push_back(pos - id);
                vec.push_back(pos + id);
            }
        }


        //3
        for(int i = 1; i <= n; i++) b[i] = a[i];
        pos = -1;
        bool ok = false;
        for(int i = 2; i <= n; i++) {
            b[i] = b[i] - b[i - 1];
            if(b[i] < 0) {
                if(!ok) pos = i, ok = true;
            }
        }
        b[1] = 0;
        if(b[n]) {
            if(pos == -1) pos = n;
        }
        int tmp = b[n];
//        if(tmp % 2) {
//            puts("NO");
//            continue;
//        }
        for(int i = n; i > 0; i -= 2) {
            if(i <= pos) {
                if(a[i] - a[i + 1] == tmp / 2 || a[i] - a[i - 1] == tmp / 2) {
                    vec.push_back(i);
                    break;
                }
            }
        }


        int sz = vec.size();
        bool flag = true;
        for(int i = 0; i < sz; i++) {
            int now = vec[i];
            if(now < 1 || now > n) continue;
            if(now > 1) {
                for(int j = 1; j <= n; j++) b[j] = a[j];
                flag = true;
                swap(b[now], b[now - 1]);
                for(int j = 2; j <= n; j++) {
                    b[j] = b[j] - b[j - 1];
                    b[j - 1] -= b[j - 1];
                    if(b[j] < 0) {
                        flag = false;
                        break;
                    }
                }
                if(b[n]) flag = false;
                if(flag) break;
            }
            if(now < n) {
                   for(int j = 1; j <= n; j++) b[j] = a[j];
                   flag = true;
                   swap(b[now], b[now + 1]);
                   for(int j = 2; j <= n; j++) {
                    b[j] = b[j] - b[j - 1];
                    b[j - 1] -= b[j - 1];
                    if(b[j] < 0) {
                        flag = false;
                        break;
                    }
                }
                if(b[n]) flag = false;
                if(flag) break;
            }
        }
        if(!sz) flag = false;
        if(flag) puts("YES");
        else puts("NO");
    }
    return 0;
}

  		 	    			 	 	 	 		 	 				 	