// Path: src/main/java/com/hackerrank/SherlockAndArray.java
// static String findIndex(int[] arr) {
//     long sum = 0;
//     for (int anArr : arr) {
//         sum += anArr;
//     }
// 
//     long rightSum = 0;
//     long leftSum = 0;
//     for (int i = 1; i < arr.length; i++) {
//         leftSum += arr[i - 1];
//         rightSum = sum - (leftSum + arr[i]);
//         if (leftSum == rightSum) {
//             return "YES";
//         }
//     }
//     return leftSum == rightSum ? "YES" : "NO";
// }


import org.junit.Test;
import static com.hackerrank.SherlockAndArray.findIndex;
import static org.junit.Assert.assertEquals;
package com.hackerrank;



public class SherlockAndArrayTest {

    @Test
    public void test1() throws Exception {
        int[] arr = new int[]{1};
// Path: src/main/java/com/hackerrank/SherlockAndArray.java
// static String findIndex(int[] arr) {
//     long sum = 0;
//     for (int anArr : arr) {
//         sum += anArr;
//     }
// 
//     long rightSum = 0;
//     long leftSum = 0;
//     for (int i = 1; i < arr.length; i++) {
//         leftSum += arr[i - 1];
//         rightSum = sum - (leftSum + arr[i]);
//         if (leftSum == rightSum) {
//             return "YES";
//         }
//     }
//     return leftSum == rightSum ? "YES" : "NO";
// }


// Path: src/test/java/com/hackerrank/SherlockAndArrayTest.java
import org.junit.Test;
import static com.hackerrank.SherlockAndArray.findIndex;
import static org.junit.Assert.assertEquals;

package com.hackerrank;



public class SherlockAndArrayTest {

    @Test
    public void test1() throws Exception {
        int[] arr = new int[]{1};
        assertEquals(findIndex(arr), "YES");