#include<bits/stdc++.h>
using namespace std;
#define int long long int
#ifdef LOCAL
#include "Template.cpp"
#else
#define t(...)
#endif


bool test(int a, int b, int c, int d) {
  vector<int> prefix = {a, b, c, d};
  vector<int> suffix = {a, b, c, d};
  t("test", prefix, suffix);
  int left = a, right = d;

  bool posleft = 1;
  for(int i = 1; i < 4; i ++) {
    if(prefix[i] >= left) {
      prefix[i] -= left;
      left = prefix[i];
    }
    else {
      posleft = 0;
      break;
    }
  }
  if(prefix[3] != 0) posleft = 0;

  bool posright = 1;
  for(int i = 2; i >= 0; i --) {
    if(suffix[i] >= right) {
      suffix[i] -= right;
      right = suffix[i];
    }
    else {
      posright = 0;
      break;
    }
  }
  if(suffix[0] != 0) posright = 0;

  return posleft || posright;

}

void solve() {
    int n; cin >> n;
    
    vector<int> arr(n);
    
    for(int i = 0; i < n; i ++) {
      cin >> arr[i];
    }
    
    if(n == 2) {
      cout << (arr[0] == arr[1] ? "YES" : "NO") << endl;
      return ; 
    }
    if(n == 3) {
      sort(arr.begin(), arr.end());
      if((arr[0] + arr[1]) == arr[2]) {
        cout << "YES" << endl;
      }
      else {
        cout << "NO" << endl;
      }
      return;
    }

    vector<int> prefix(n, -1);
    vector<int> suffix(n, -1);
    
    int left = 0, right = 0;
    
    for(int i = 0; i < n; i ++) {
      if(arr[i] >= left) {
        prefix[i] = arr[i] - left;
        left = prefix[i];
      }
      else {
        break;
      }
    }

    for(int i = n-1; i >= 0; i --) {
      if(arr[i] >= right) {
        suffix[i] = arr[i] - right;
        right = suffix[i];
      }
      else {
        break;
      }
    }

    t(prefix);
    t(suffix);

    auto pget = [&](int i) {
      if(i < 0) return 0LL;
      else return prefix[i];
    };
    auto sget = [&](int i) {
      if(i > n-1) return 0LL;
      else return suffix[i];
    };

    bool pos = 0;
    for(int i = 0; i < n-1; i ++) {
      int a = pget(i-1);
      int b = arr[i];
      int c = arr[i + 1];
      int d = sget(i + 2);
      t(a, b, c, d);
      if(a != -1 && d != -1) {
        bool res1 = test(a, b, c, d);
        bool res2 = test(a, c, b, d);
        t(res1, res2);
        if(res1 || res2) {
          pos = 1;
          break;
        }
      }
    }

    cout << (pos ? "YES" : "NO") << endl;
}

int32_t main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    int t = 1;
    cin >> t;
    while(t --) {
        solve();
    }
}