text: #include <assert.h>
  #include <ctype.h>
  #include <limits.h>
  #include <math.h>
  #include <stdbool.h>
  #include <stddef.h>
  #include <stdint.h>
  #include <stdio.h>
  #include <stdlib.h>
  #include <string.h>
  
  char* readline();
  char* ltrim(char*);
  char* rtrim(char*);
  char** split_string(char*);
  
  int parse_int(char*);
  
  /*
   * Complete the 'balancedSums' function below.
   *
   * The function is expected to return a STRING.
   * The function accepts INTEGER_ARRAY arr as parameter.
   */
  
  /*
   * To return the string from the function, you should either do static allocation or dynamic allocation
   *
   * For example,
   * char* return_string_using_static_allocation() {
   *     static char s[] = "static allocation of string";
   *
   *     return s;
   * }
   *
   * char* return_string_using_dynamic_allocation() {
   *     char* s = malloc(100 * sizeof(char));
   *
   *     s = "dynamic allocation of string";
   *
   *     return s;
   * }
   *
   */
   /*
  char* balancedSums(int arr_count, int* arr) {
      int lIndex = 0, rIndex = arr_count - 1;
      int lSum = arr[0], rSum = arr[arr_count - 1];
      
      while(lIndex<rIndex+1)
      {
          if (lSum < rSum)
          {
              lIndex++;
              lSum += arr[lIndex];
          }
          else if (lSum > rSum)
          {
              rIndex--;
              rSum += arr[rIndex];
          }
          else
          {
              lIndex++;
              rIndex--;
          }
      }
      if (lSum == rSum)
      {
          return "YES";
      }
      else
      {
          return "NO";
      }
  }
  */
  
  char* balancedSums(int arr_count, int* arr, int sum) {
      // {x + y + x = sum} => {2x = sum - y}
      if (arr_count == 1)
          return "YES";
      int x = 0;
      for(int i = 0; i<arr_count - 1; i++)
      {
          int y = arr[i];
          if (2*x == sum - y)
          {
              return "YES";
          }
          x = x + y;
          if (2*x > sum)
          {
              break;
          }
      }
      return "NO";
  }
  
  int main()
  {
      FILE* fptr = fopen(getenv("OUTPUT_PATH"), "w");
  
      int T = parse_int(ltrim(rtrim(readline())));
  
      for (int T_itr = 0; T_itr < T; T_itr++) {
          int n = parse_int(ltrim(rtrim(readline())));
  
          char** arr_temp = split_string(rtrim(readline()));
  
          int* arr = malloc(n * sizeof(int));
          int sum = 0;
          for (int i = 0; i < n; i++) {
              int arr_item = parse_int(*(arr_temp + i));
  
              *(arr + i) = arr_item;
              sum += arr_item;
          }
  
          char* result = balancedSums(n, arr, sum);
  
          fprintf(fptr, "%s\n", result);
      }
  
      fclose(fptr);
  
      return 0;
  }
  
  char* readline() {
      size_t alloc_length = 1024;
      size_t data_length = 0;
  
      char* data = malloc(alloc_length);
  
      while (true) {
          char* cursor = data + data_length;
          char* line = fgets(cursor, alloc_length - data_length, stdin);
  
          if (!line) {
              break;
          }
  
          data_length += strlen(cursor);
  
          if (data_length < alloc_length - 1 || data[data_length - 1] == '\n') {
              break;
          }
  
          alloc_length <<= 1;
  
          data = realloc(data, alloc_length);
  
          if (!data) {
              data = '\0';
  
              break;
          }
      }
  
      if (data[data_length - 1] == '\n') {
          data[data_length - 1] = '\0';
  
          data = realloc(data, data_length);
  
          if (!data) {
              data = '\0';
          }
      } else {
          data = realloc(data, data_length + 1);
  
          if (!data) {
              data = '\0';
          } else {
              data[data_length] = '\0';
          }
      }
  
      return data;
  }
  
  char* ltrim(char* str) {
      if (!str) {
          return '\0';
      }
  
      if (!*str) {
          return str;
      }
  
      while (*str != '\0' && isspace(*str)) {
          str++;
      }
  
      return str;
  }
  
  char* rtrim(char* str) {
      if (!str) {
          return '\0';
      }
  
      if (!*str) {
          return str;
      }
  
      char* end = str + strlen(str) - 1;
  
      while (end >= str && isspace(*end)) {
          end--;
      }
  
      *(end + 1) = '\0';
  
      return str;
  }
  
  char** split_string(char* str) {
      char** splits = NULL;
      char* token = strtok(str, " ");
  
      int spaces = 0;
  
      while (token) {
          splits = realloc(splits, sizeof(char*) * ++spaces);
  
          if (!splits) {
              return splits;
          }
  
          splits[spaces - 1] = token;
  
          token = strtok(NULL, " ");
      }
  
      return splits;
  }
  
  int parse_int(char* str) {
      char* endptr;
      int value = strtol(str, &endptr, 10);
  
      if (endptr == str || *endptr != '\0') {
          exit(EXIT_FAILURE);
      }
  
      return value;
  }
  