#include using namespace std; bool hasSum(int* array, int n) { int m = 0; while(m != n) { if(array[m] == array[n] - array[m++]) { return true; } } return false; } int main() { int n, m; while(cin >> n) { int* array = new int[n+1]; m = 0; for(int i = 0; i < n+1; i++) { array[i] = 0; } while(m != n) { cin >> array[m++]; array[n] += array[m-1]; } if(hasSum(array,n)) { cout << "YES" << endl; delete[] array; continue; } cout << "NO" << endl; delete[] array; } return 0; }