Problem Description

Check if the array can be split into three contiguous parts with equal sum. Print YES or NO.

Input Format

First n. Next line n integers.

Output Format

YES or NO.

Sample Test Case

Input:
6 1 2 3 0 3 0
Output:
YES

Constraints

n

Solutions (0)

No solutions submitted yet. Be the first!

Discussion (0)

No comments yet. Start the discussion!

Prev Next