#include <bits/stdc++.h>
#define int long long

//#pragma GCC target ("avx2")
//#pragma GCC optimization ("O3")
//#pragma GCC optimization ("unroll-loops")

//#include <ext/pb_ds/assoc_container.hpp>
//#include <ext/pb_ds/tree_policy.hpp>
//using namespace __gnu_pbds;
//#define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update>


using namespace std;


signed main() {
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
	int t;
	cin >> t;
	while (t--) {
		int n;
		cin >> n;
		int a[n + 5], b[n + 5], c[n + 5];
		for (int i = 1; i <= n; ++i) {
			cin >> a[i];
		}
		b[0] = 0;
		c[n + 1] = 0;
		for (int i = 1; i <= n; ++i) {
			if (b[i - 1] == -1) b[i] = -1;
			else {
				b[i] = a[i] - b[i - 1];
				if (b[i] < 0) b[i] = -1;
			}
		}
		for (int i = n; i >= 1; --i) {
			if (c[i + 1] == -1) c[i] = -1;
			else {
				c[i] = a[i] - c[i + 1];
				if (c[i] < 0) c[i] = -1;
			}
		}
		if (b[n] == 0) {
			cout << "YES\n";
			goto qu;
		}
		for (int i = 1; i + 1 <= n; ++i) {
			if (b[i - 1] == -1 || c[i + 2] == -1) continue;
			if (b[i - 1] <= a[i + 1] && a[i] >= c[i + 2] && a[i + 1] - b[i - 1] == a[i] - c[i + 2]) {
				cout << "YES\n";
				goto qu;
			}
		}
		cout << "NO\n";
		qu: {}
	}
	return 0;
}
