def solve(self, cipher):
        """
        main solution function
        :param cipher: the cipher
        """
        N, A = cipher
        f = [0 for _ in xrange(N + 1)]
        for i in xrange(1, N + 1):
            f[i] = f[i - 1] + A[1 - i]

        for i in xrange(N):
            if f[i] == f[N] - f[i + 1]:
                return "YES"
        return "NO"
dataset/ETHPy150Open algorhythms/HackerRankAlgorithms/Sherlock and Array.py/Solution.solve/swapped operands of `-`