def main(): N = int(input()) A = list(map(int, input().split())) MOD = 998244353 dp_table = [[0 for _ in range(20002)] for _ in range(N + 1)] dp_table[0][10000] = 1 for idx, value in enumerate(A): for cur_sum_idx in range(20002): cur_sum = cur_sum_idx - 10000 if abs(cur_sum - value) <= 10000: dp_table[idx + 1][cur_sum_idx - value] += dp_table[idx][cur_sum_idx] if abs(cur_sum + value) <= 10000: dp_table[idx + 1][cur_sum_idx + value] += dp_table[idx][cur_sum_idx] total_sum = 0 for sum_value, ctr_n in enumerate(dp_table[-1], -10000): total_sum += (abs(sum_value) * ctr_n) % MOD total_sum %= MOD print(total_sum) if __name__ == "__main__": main()