We’re preparing your current view and syncing the latest data.
A young physicist has n forces acting on him, each force represented by its Cartesian coordinates (x, y, z). The task is to find out if the sum of all these forces results in a zero vector, meaning the forces are in equilibrium. If the sum of the x components, y components, and z components of all forces is zero respectively, then print YES, otherwise print NO.
The first line contains a single integer n — the number of forces acting on the physicist. Then n lines follow, each containing three integers xi, yi, zi — the components of the ith force along the x, y, and z axes.
Print YES if the net force acting on the physicist is zero. Otherwise, print NO.
1 ≤ n ≤ 100 -100 ≤ xi, yi, zi ≤ 100
Example 1
Input
3 4 1 7 -2 4 -1 -2 -5 -6
Output
YES
Explanation
The sum of the forces is (4 + (-2) + (-2), 1 + 4 + (-5), 7 + (-1) + (-6)) = (0, 0, 0) which means the forces are in equilibrium.