#include <bits/stdc++.h>

using namespace std;

int main()
{
    long long int n, i, l, r, sum1=0, sum2=0;
    cin>>n;
    vector<long long int> a(n);
    for (i=0; i<n; i++)
        cin>>a[i];
    sort(a.begin(), a.end());
    sum1=a[n-1]-a[n-2];
    for (i=n-3; i>0; i--)
    {
        sum1=abs(a[i]-sum1);
    }
    if (n==2 && sum1==0)
        cout<<"YES";
    else
    {
        if (n==2 && sum1!=0)
            cout<<"NO";
        else
        {
            for (i=1; i<n; i++)
            {
                if (a[i]!=a[i-1])
                    break;
            }
            if (i==n && a[0]%2==0)
                cout<<"YES";
            else
            {
                if (i==n && a[0]%2!=0)
                    cout<<"NO";
                else
                {
                    if (sum1==a[0])
                        cout<<"YES";
                    else
                        cout<<"NO";
                }
            }
        }
    }
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

int main()
{
    long long int n, sum=0, mmax, i;
    cin>>n;
    vector<long long int> a(n);
    mmax=-1;
    for (i=0; i<n; i++)
    {
        cin>>a[i];
        sum+=a[i];
        mmax=max(mmax, a[i]);
    }
    if (mmax>sum || sum%2!=0)
        cout<<"NO";
    else
        cout<<"YES";
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

int main()
{
    int n, i, l, r, sum1, sum2;
    cin>>n;
    vector<int> a(n);
    for (i=0; i<n; i++)
        cin>>a[i];
    sort(a.begin(), a.end());
    i=0;
    sort(a.begin(), a.end());
    while(i<a.size())
    {
        if (i+1<a.size() && a[i]==a[i+1])
        {
            a.erase(a.begin()+i);
            a.erase(a.begin()+i);
        }
        else
            i++;
    }
        if (a.empty())
            cout<<"YES";
        else
        {
            l=1; r=a.size()-2;
    sum1=a[0]; sum2=a[a.size()-1];
    while (l<=r)
    {
        if (sum1<=sum2)
        {
            sum1+=a[l];
            l++;
        }
        else
        {
            sum2+=a[r];
            r--;
        }
    }
    if (sum1==sum2)
        cout<<"YES";
    else
        cout<<"NO";
        }

    return 0;
}


#include <bits/stdc++.h>

using namespace std;

int main()
{
    long long int n, i, l, r, sum1, sum2;
    cin>>n;
    vector<long long int> a(n);
    for (i=0; i<n; i++)
        cin>>a[i];
    sort(a.begin(), a.end());
    sum1=a[1]-a[0];
    for (i=2; i<n; i++)
    {
        sum1=a[i]-sum1;
    }
    if (sum1%2==0)
        cout<<"YES";
    else
        cout<<"NO";
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

int main()
{
    long long int n, sum=0, mmax, i;
    cin>>n;
    vector<long long int> a(n);
    mmax=-1;
    for (i=0; i<n; i++)
    {
        cin>>a[i];
        sum+=a[i];
        mmax=max(mmax, a[i]);
    }
    if (mmax*2>sum || sum%2!=0)
        cout<<"NO";
    else
        cout<<"YES";
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

int main()
{
    long long int n, i, l, r, sum1, sum2;
    cin>>n;
    vector<long long int> a(n);
    for (i=0; i<n; i++)
        cin>>a[i];
    sort(a.begin(), a.end());
    l=1; r=n-2;
    sum1=a[0];
    sum2=a[n-1];
    while(l<=r)
    {
        if (sum1==sum2)
        {
            if ((r-1)-(l+1)>0)
            {
                r--; l++;
                sum1=a[l];
                sum2=a[r];
            }
            else
            {
                r--; l++;
                n=1;
            }
        }
        else
        {
            if (sum1<sum2)
            {
                sum1+=a[l];
                l++;
            }
            else
            {
                sum2+=a[r];
                r--;
            }
        }
    }
    if (sum1==sum2 && n!=1)
        cout<<"YES";
    else
    {
        if (n==1 && a[l]%2==0)
            cout<<"YES";
            else
            cout<<"NO";
    }
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

int main()
{
    long long int n, i, l, r, sum1=0, sum2=0;
    cin>>n;
    vector<long long int> a(n);
    for (i=0; i<n; i++)
        cin>>a[i];
    sort(a.begin(), a.end());
    l=0;
    while (l+1<n && a[l]==a[l+1])
        l+=2;
    r=n-1;
    while (r>0 && a[r]==a[r-1])
        r-=2;
    if (l<r)
    {
        sum1=a[l];
        l++;
        sum2=a[r];
        r--;
        while (l<=r)
    {
        if (sum1<sum2)
        {
            sum1+=a[l];
            l++;
        }
        else
        {
            sum2+=a[r];
            r--;
        }
    }
    }
    for (i=1; i<n; i++)
    {
        if (a[i]!=a[i-1])
            break;
    }
    if (i==n && a[0]%2!=0 && n%2!=0)
        cout<<"NO";
    else
    {
        if (i==n)
            cout<<"YES";
        else
        {
            if (sum1==sum2)
                cout<<"YES";
            else
                cout<<"NO";
        }
    }
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

int main()
{
    long long int n, i, l, r, sum1, sum2;
    cin>>n;
    vector<long long int> a(n);
    for (i=0; i<n; i++)
        cin>>a[i];
    sort(a.begin(), a.end());
    i=0;
    sort(a.begin(), a.end());
    while(i<a.size())
    {
        if (i+1<a.size() && a[i]==a[i+1])
        {
            a.erase(a.begin()+i);
            a.erase(a.begin()+i);
        }
        else
            i++;
    }
        if (a.empty())
            cout<<"YES";
        else
        {
            l=1; r=a.size()-2;
    sum1=a[0]; sum2=a[a.size()-1];
    while (l<=r)
    {
        if (sum1<=sum2)
        {
            sum1+=a[l];
            l++;
        }
        else
        {
            sum2+=a[r];
            r--;
        }
    }
    if (sum1==sum2)
        cout<<"YES";
    else
        cout<<"NO";
        }

    return 0;
}


#include <bits/stdc++.h>

using namespace std;

int main()
{
    long long int n, i, l, r, sum1=0, sum2=0;
    cin>>n;
    vector<long long int> a(n);
    for (i=0; i<n; i++)
        cin>>a[i];
    sort(a.begin(), a.end());
    sum1=a[n-1]-a[n-2];
    for (i=n-3; i>0; i--)
    {
        sum1=abs(a[i]-sum1);
    }
    if (n==2 && sum1==0)
        cout<<"YES";
    else
    {
        if (n==2 && sum1!=0)
            cout<<"NO";
        else
        {
            for (i=1; i<n; i++)
            {
                if (a[i]!=a[i-1])
                    break;
            }
            if (i==n && a[0]%2!=0 && n%2!=0)
                cout<<"NO";
            else
            {
                if (i==n && a[0]%2==0 || (a[0]%2!=0 && n%2==0))
                    cout<<"YES";
                else
                {
                    if (sum1==a[0])
                        cout<<"YES";
                    else
                        cout<<"NO";
                }
            }
        }
    }
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

int main()
{
    long long int n, i, l, r, sum1, sum2;
    cin>>n;
    vector<long long int> a(n);
    for (i=0; i<n; i++)
        cin>>a[i];
    sort(a.begin(), a.end());
    l=1; r=n-2;
    sum1=a[0];
    sum2=a[n-1];
    while(l<=r)
    {
       if (sum1<sum2)
       {
           sum1+=a[l];
           l++;
       }
       else
       {
           sum2+=a[r];
           r--;
       }

    }
    if (abs(sum1-sum2)%2==0)
        cout<<"YES";
    else
    {
            cout<<"NO";
    }
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

int main()
{
    long long int n, i, l, r, sum1, sum2;
    cin>>n;
    vector<long long int> a(n);
    for (i=0; i<n; i++)
        cin>>a[i];
    sort(a.begin(), a.end());
    i=0;
    sort(a.begin(), a.end());
    while(i<a.size())
    {
        if (i+1<a.size() && a[i]==a[i+1])
        {
            a.erase(a.begin()+i);
            a.erase(a.begin()+i);
        }
        else
            i++;
    }
    if (a.empty())
        cout<<"YES";
    else
    {
        if (a.size()==1)
            cout<<"NO";
        else
        {
            n=a.size();
            l=1;
            r=n-2;
            sum1=a[0];
            sum2=a[n-1];
            while (l<=r)
            {
                if (sum1<=sum2)
                {
                    sum1+=a[l];
                    l++;
                }
                else
                {
                    sum2+=a[r];
                    r--;
                }
            }
            if (sum1==sum2)
                cout<<"YES";
            else
                cout<<"NO";
        }

    }

    return 0;
}


#include <bits/stdc++.h>

using namespace std;

int main()
{
    long long int n, i, l, r, sum1=0, sum2=0;
    cin>>n;
    vector<long long int> a(n);
    for (i=0; i<n; i++)
        cin>>a[i];
    sort(a.begin(), a.end());
    sum1=a[0]; sum2=a[n-1];
    l=1; r=n-2;
    bool p=0;
    while (l<=r)
    {
        if (sum1<sum2)
        {
            sum1+=a[l];
            l++;
        }
        else
        {
            if (sum2<sum1)
            {
                sum2+=a[r];
                r--;
            }
            else
            {
                for (i=l+1; i<=r; i++)
                {
                    if (a[i]!=a[i-1])
                        break;
                }
                if (i==r+1 && (a[r]%2==0 || (r-l+1)%2==0))
                {
                        p=1;
                    break;
                }
                else
                    {
                        sum2+=a[r];
                        r--;
                    }

            }
        }
    }
    for (i=1; i<n; i++)
    {
        if (a[i]!=a[i-1])
            break;
    }
    if (i==n)
    {
        if (a[0]%2!=0 && n%2!=0)
            cout<<"NO";
        else
            cout<<"YES";
    }
    else
    {
       if (p || sum1==sum2)
        cout<<"YES";
        else
            cout<<"NO";
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n,count=0;
    cin>>n;
    int a[n];
    for (int i=0;i<n;i++)
        cin>>a[i];
    sort(a,a+n);
    int i=0;
    while(i+1<n)
    {

        if (a[i]!=0 && a[i+1]!=0)
        {
            if (a[i]<a[i+1])
            {
                a[i]=0;
                a[i+1]=a[i+1]-a[i];
                i=i+1;
            }
            else if (a[i]==a[i+1])
            {
                a[i]=0;
                a[i+1]=0;
                i=i+2;
            }
        }
        else if (a[i]==0)
            i++;
    }
        for (int i=0;i<n;i++)
        {
            if (a[i]==0)
                count++;
        }
        if (count==n)
            cout<<"YES";
        else
            cout<<"NO";
        return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    long int n,count=0;
    cin>>n;
    long int a[n];
    for (long int i=0;i<n;i++)
        cin>>a[i];
    sort(a,a+n);
    long int i=0;
    while(i+1<n)
    {

        if (a[i]!=0 && a[i+1]!=0)
        {
            if (a[i]<a[i+1])
            {
                a[i]=0;
                a[i+1]=a[i+1]-a[i];
                i=i+1;
            }
            else if (a[i]==a[i+1])
            {
                a[i]=0;
                a[i+1]=0;
                i=i+2;
            }
        }
        else if (a[i]==0)
            i++;
    }
        for (long int i=0;i<n;i++)
        {
            if (a[i]==0)
                count++;
        }
        if (count==n)
            cout<<"YES";
        else
            cout<<"NO";
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n,count=0;
    cin>>n;
    int a[n];
    for (int i=0;i<n;i++)
        cin>>a[i];
    sort(a,a+n);
    int i=0;
    while(i+1<n)
    {

        if (a[i]!=0 && a[i+1]!=0)
        {
            if (a[i]<a[i+1])
            {
                a[i]=0;
                a[i+1]=a[i+1]-a[i];
                i=i+1;
            }
            else if (a[i]>a[i+1])
            {
                a[i+1]=0;
                a[i]=a[i]-a[i+1];
                i=i;
            }
            else if (a[i]==a[i+1])
            {
                a[i]=0;
                a[i+1]=0;
                i=i+2;
            }
        }
    }
        for (int i=0;i<n;i++)
        {
            if (a[i]==0)
                count++;
        }
        if (count==n)
            cout<<"YES";
        else
            cout<<"NO";
        return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n,count=0;
    cin>>n;
    int a[n];
    for (int i=0;i<n;i++)
        cin>>a[i];
    sort(a,a+n);
    int i=0;
    while(i+1<n)
    {

        if (a[i]!=0 && a[i+1]!=0)
        {
            if (a[i]<a[i+1])
            {
                a[i]=0;
                a[i+1]=a[i+1]-a[i];
                i=i+1;
            }
            else if (a[i]==a[i+1])
            {
                a[i]=0;
                a[i+1]=0;
                i=i+2;
            }
        }
    }
        for (int i=0;i<n;i++)
        {
            if (a[i]==0)
                count++;
        }
        if (count==n)
            cout<<"YES";
        else
            cout<<"NO";
        return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n,count=0;
    cin>>n;
    int a[n];
    for (int i=0;i<n;i++)
        cin>>a[i];
    sort(a,a+n);
    int i=0;
    while(i+1<n)
    {

        if (a[i]!=0 && a[i+1]!=0)
        {
            if (a[i]<a[i+1])
            {
                a[i]=0;
                a[i+1]=a[i+1]-a[i];
                i=i+1;
                sort(a,a+n);
            }
            else if (a[i]==a[i+1])
            {
                a[i]=0;
                a[i+1]=0;
                i=i+2;
                sort(a,a+n);
            }
        }
        else if (a[i]==0)
            i++;
    }
        for (int i=0;i<n;i++)
        {
            if (a[i]==0)
                count++;
        }
        if (count==n)
            cout<<"YES";
        else
            cout<<"NO";
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n,count=0;
    cin>>n;
    int a[n];
    for (int i=0;i<n;i++)
        cin>>a[i];
    sort(a,a+n);
    int i=0;
    while(i<n-1)
    {
        if (a[i+1]!=a[i])
        {

        a[i+1]=a[i+1]-a[i];
        a[i]=0;
        i++;
        }
        else
        {
            a[i+1]=0;
            a[i]=0;
            i=i+2;
        }

    }
    for (long int i=0;i<n;i++)
        {
            if (a[i]==0)
                count++;
        }
        if (count==n)
            cout<<"YES";
        else
            cout<<"NO";
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    long int n,count=0;
    cin>>n;
    long int a[n];
    for (long int i=0;i<n;i++)
        cin>>a[i];
    sort(a,a+n);
    long int i=0;
    while(i+1<n)
    {

        if (a[i]!=0 && a[i+1]!=0)
        {
            if (a[i]<a[i+1])
            {
                a[i]=0;
                a[i+1]=a[i+1]-a[i];
                i=i+1;
            }
            else if (a[i]==a[i+1])
            {
                a[i]=0;
                a[i+1]=0;
                i=i+1;
            }
        }
        else if (a[i]==0)
            i++;
    }
        for (long int i=0;i<n;i++)
        {
            if (a[i]==0)
                count++;
        }
        if (count==n)
            cout<<"YES";
        else
            cout<<"NO";
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n,count=0;
    cin>>n;
    int a[n];
    long long int sum=0;
    for (int k=0;k<n;k++)
        {
            cin>>a[k];
            sum+=a[k];
        }
    sort(a,a+n);
    if (sum%2==0 && a[n-1]<=sum-a[n-1])
        cout<<"YES";
    else cout<<"NO";

}


#include <bits/stdc++.h>

#define bg begin();
#define ed end();
#define ios ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0);
#define F first
#define S second
#define nl '\n';
#define sit it=s.begin(); it !=s.end(); it++
#define all(x) x.begin(),x.end()
#define sz(x) (int)x.size()
#define alll(a) a ,a + n
#define iti set <int> ::iterator it;
#define pp pop_back
#define pb push_back
typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;
const int N = (int)5e5 + 7;

using namespace std;

int a[N];
int t,z;
ll ans;

int main(){
    int n;
    cin >> n;
    for(int i = 1;n >= i;i++){
        cin >> a[i];
    }
    sort(a + 1,a + n + 1);
    for(int i = 2;n >= i;i++){
        a[i] -= a[i-1];
    }
    if(a[n]==0) {cout<<"YES";return 0;}
        cout<<"NO";
}


#include <bits/stdc++.h>

#define bg begin();
#define ed end();
#define ios ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0);
#define F first
#define S second
#define nl '\n';
#define sit it=s.begin(); it !=s.end(); it++
#define all(x) x.begin(),x.end()
#define sz(x) (int)x.size()
#define alll(a) a ,a + n
#define iti set <int> ::iterator it;
#define pp pop_back
#define pb push_back
typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;
const int N = (int)5e5 + 7;

using namespace std;

int a[N];
int t,z;
ll ans;

int main(){
    int n;
    cin >> n;
    for(int i = 1;n >= i;i++){
        cin >> a[i];
        ans += a[i];
        if(a[i] % 2 == 1) t++;
        else z++;
    }
    if(ans % 2 == 0&&t % 2 == 0&&z % 2 == 0){
        cout<<"YES";
        return 0;
    }
    cout<<"NO";
}
#include <bits/stdc++.h>

#define bg begin();
#define ed end();
#define ios ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0);
#define F first
#define S second
#define nl '\n';
#define sit it=s.begin(); it !=s.end(); it++
#define all(x) x.begin(),x.end()
#define sz(x) (int)x.size()
#define alll(a) a ,a + n
#define iti set <int> ::iterator it;
#define pp pop_back
#define pb push_back
typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;
const int N = (int)5e5 + 7;

using namespace std;

int a[N];
int t,z;
ll ans;

int main(){
    int n;
    cin >> n;
    for(int i = 1;n >= i;i++){
        cin >> a[i];
        ans += a[i];
        if(a[i] % 2 == 1) t++;
        else z++;
    }
    if(ans % 2 == 0&&t % 2 == 0&&z % 2 == 0){
        cout<<"YES";
        return 0;
    }
    cout<<"NO";
}


#include <bits/stdc++.h>

#define bg begin();
#define ed end();
#define ios ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0);
#define F first
#define S second
#define nl '\n';
#define sit it=s.begin(); it !=s.end(); it++
#define all(x) x.begin(),x.end()
#define sz(x) (int)x.size()
#define alll(a) a ,a + n
#define iti set <int> ::iterator it;
#define pp pop_back
#define pb push_back
typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;
const int N = (int)5e5 + 7;

using namespace std;

int a[N];
int t,z;
ll ans;

int main(){
    int n;
    cin >> n;
    for(int i = 1;n >= i;i++){
        cin >> a[i];
    }
    sort(a + 1,a + n + 1);
    for(int i = 1;n >= i;i++){
        if(a[i] == a[i+1]){a[i] = 0;a[i-1] = 0;}
        a[i] -= a[i-1];
    }

    if(a[n]==0) {cout<<"YES";return 0;}
        cout<<"NO";
}


#include <bits/stdc++.h>

#define bg begin();
#define ed end();
#define ios ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0);
#define F first
#define S second
#define nl '\n';
#define sit it=s.begin(); it !=s.end(); it++
#define all(x) x.begin(),x.end()
#define sz(x) (int)x.size()
#define alll(a) a ,a + n
#define iti set <int> ::iterator it;
#define pp pop_back
#define pb push_back
typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;
const int N = (int)5e5 + 7;

using namespace std;

int a[N];
int t,z;
ll ans;

int main(){
    int n;
    cin >> n;
    for(int i = 1;n >= i;i++){
        cin >> a[i];
    }
    sort(a + 1,a + n + 1);
    for(int i = 1;n >= i;i++){
        if(a[i] == a[i-1]){a[i] = 0;a[i-1] = 0;}
        a[i] -= a[i-1];
    }

    if(a[n]==0) {cout<<"YES";return 0;}
        cout<<"NO";
}


#include <bits/stdc++.h>

#define bg begin();
#define ed end();
#define ios ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0);
#define F first
#define S second
#define nl '\n';
#define sit it=s.begin(); it !=s.end(); it++
#define all(x) x.begin(),x.end()
#define sz(x) (int)x.size()
#define alll(a) a ,a + n
#define iti set <int> ::iterator it;
#define pp pop_back
#define pb push_back
typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;
const int N = (int)5e5 + 7;

using namespace std;

int a[N];
ll ans;

int main(){
    int n;
    cin >> n;
    for(int i = 1;n >= i;i++){
        cin >> a[i];
        ans += a[i];
    }
    if(ans >= n * 2){cout<<"NO";return 0;}
    if(ans % 2 == 0){
        cout<<"YES";
        return 0;
    }
    cout<<"NO";
}


#include <bits/stdc++.h>

#define bg begin();
#define ed end();
#define ios ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0);
#define F first
#define S second
#define nl '\n';
#define sit it=s.begin(); it !=s.end(); it++
#define all(x) x.begin(),x.end()
#define sz(x) (int)x.size()
#define alll(a) a ,a + n
#define iti set <int> ::iterator it;
#define pp pop_back
#define pb push_back
typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;
const int N = (int)5e5 + 7;

using namespace std;

int a[N];
int t,z;
ll ans;

int main(){
    int n;
    cin >> n;
    for(int i = 1;n >= i;i++){
        cin >> a[i];
        ans += a[i];
        if(a[i] % 2 == 1) t++;
        else z++;
    }
    if(ans % 2 == 0&&t % 2 == 0&&z % 2 == 0){
        cout<<"YES";
        return 0;
    }
    cout<<"NO";
}


#include <bits/stdc++.h>

#define bg begin();
#define ed end();
#define ios ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0);
#define F first
#define S second
#define nl '\n';
#define sit it=s.begin(); it !=s.end(); it++
#define all(x) x.begin(),x.end()
#define sz(x) (int)x.size()
#define alll(a) a ,a + n
#define iti set <int> ::iterator it;
#define pp pop_back
#define pb push_back
typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;
const int N = (int)5e5 + 7;

using namespace std;

int a[N];
int t,z;
ll ans;

int main(){
    int n;
    cin >> n;
    for(int i = 1;n >= i;i++){
        cin >> a[i];
        ans += a[i];
        if(a[i] % 2 == 1) t++;
        else z++;
    }
    if(ans % 2 == 0&&t % 2 == 0){
        cout<<"YES";
        return 0;
    }
    cout<<"NO";
}


#include <bits/stdc++.h>

#define bg begin();
#define ed end();
#define ios ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0);
#define F first
#define S second
#define nl '\n';
#define sit it=s.begin(); it !=s.end(); it++
#define all(x) x.begin(),x.end()
#define sz(x) (int)x.size()
#define alll(a) a ,a + n
#define iti set <int> ::iterator it;
#define pp pop_back
#define pb push_back
typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;
const int N = (int)5e5 + 7;

using namespace std;

int a[N];
int t,z;
ll ans;

int main(){
    int n;
    cin >> n;
    for(int i = 1;n >= i;i++){
        cin >> a[i];
        ans+=a[i];
        t = max(t,a[i]);
    }
    if(ans % 2 == 0&&t <= ans - t){
        cout<<"YES";
        return 0;
    }
    cout<<"NO";
}


#include <bits/stdc++.h>

#define bg begin();
#define ed end();
#define ios ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0);
#define F first
#define S second
#define nl '\n';
#define sit it=s.begin(); it !=s.end(); it++
#define all(x) x.begin(),x.end()
#define sz(x) (int)x.size()
#define alll(a) a ,a + n
#define iti set <int> ::iterator it;
#define pp pop_back
#define pb push_back
typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;
const int N = (int)5e5 + 7;

using namespace std;

int a[N];
ll ans;

int main(){
    int n;
    cin >> n;
    for(int i = 1;n >= i;i++){
        cin >> a[i];
        ans += a[i];
    }
    if(ans % 2 == 0){
        cout<<"YES";
        return 0;
    }
    cout<<"NO";
}


#include <bits/stdc++.h>

using namespace std;
#define M 998244353
#define ll long long
#define fio ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
bool solve(vector<ll> a, ll n, ll sum)
{

    bool subset[n+1][sum+1];

    for (int i = 0; i <= n; i++)
      subset[i][0] = true;

    for (int i = 1; i <= sum; i++)
      subset[0][i] = false;

     for (int i = 1; i <= n; i++)
     {
       for (int j = 1; j <= sum; j++)
       {
         if(j<a[i-1])
         subset[i][j] = subset[i-1][j];
         if (j >= a[i-1])
           subset[i][j] = subset[i-1][j] ||
                                 subset[i - 1][j-a[i-1]];
       }
     }
     return subset[n][sum];
}

int main()
{
	fio
	int test;
	test=1;
	while(test--)
	{
		ll n,sum=0;
		cin>>n;
		vector<ll> a(n);
		for(ll i=0;i<n;i++)
		{
			cin>>a[i];
			sum+=a[i];
		}
		if(sum%2!=0)
		{
			cout<<"NO";
		}
		else
		{
			sum=sum/10;
			if(solve(a,n,sum))
			cout<<"YES";
			else
			cout<<"NO";
		}
	}
	return 0;
}


#include <bits/stdc++.h>

using namespace std;
#define M 998244353
#define ll long long
#define fio ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
bool solve(vector<ll> a,ll i,ll sum,ll n)
{
	if(sum==0)
	return true;
	if(i>=n)
	return false;
	if(solve(a,i+1,sum,n)||solve(a,i+1,sum-a[i],n))
	return true;
	return false;
}

int main()
{
	fio
	int test;
	test=1;
	while(test--)
	{
		ll n,sum=0;
		cin>>n;
		vector<ll> a(n);
		for(ll i=0;i<n;i++)
		{
			cin>>a[i];
			sum+=a[i];
		}
		if(sum%2!=0)
		{
			cout<<"NO";
		}
		else
		{
			sum=sum/10;
			if(solve(a,0,sum,n))
			cout<<"YES";
			else
			cout<<"NO";
		}
	}
	return 0;
}


#include <bits/stdc++.h>

using namespace std;
#define M 998244353
#define ll long long
#define fio ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
bool solve(vector<ll> a, ll n, ll sum)
{
    // The value of subset[i][j] will be true if there is a
    // subset of set[0..j-1] with sum equal to i
    bool subset[n+1][sum+1];

    // If sum is 0, then answer is true
    for (int i = 0; i <= n; i++)
      subset[i][0] = true;

    // If sum is not 0 and set is empty, then answer is false
    for (int i = 1; i <= sum; i++)
      subset[0][i] = false;

     // Fill the subset table in botton up manner
     for (int i = 1; i <= n; i++)
     {
       for (int j = 1; j <= sum; j++)
       {
         if(j<a[i-1])
         subset[i][j] = subset[i-1][j];
         if (j >= a[i-1])
           subset[i][j] = subset[i-1][j] ||
                                 subset[i - 1][j-a[i-1]];
       }
     }
     return subset[n][sum];
}

int main()
{
	fio
	int test;
	test=1;
	while(test--)
	{
		ll n,sum=0;
		cin>>n;
		vector<ll> a(n);
		for(ll i=0;i<n;i++)
		{
			cin>>a[i];
			sum+=a[i];
		}
		if(sum%2!=0)
		{
			cout<<"NO";
		}
		else
		{
			sum=sum/2;
			if(solve(a,n,sum))
			cout<<"YES";
			else
			cout<<"NO";
		}
	}
	return 0;
}


#include <bits/stdc++.h>

using namespace std;
#define M 998244353
#define ll long long
#define fio ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);

int main()
{
	fio
	int test;
	test=1;
	while(test--)
	{
		ll n,sum=0;
		cin>>n;
		vector<ll> a(n);
		for(ll i=0;i<n;i++)
		{
			cin>>a[i];
			sum+=a[i];
		}
		if(sum%2!=0)
		{
			cout<<"NO";
		}
		else
		{
			ll diff=0;
			for(ll i=0;i<n-1;i++)
			{
				diff+=(a[i+1]-a[i]);
			}
			if(diff%2==0)
			cout<<"YES";
			else
			cout<<"NO";
		}
	}
	return 0;
}


#include <bits/stdc++.h>

using namespace std;
#define M 998244353
#define ll long long
#define fio ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);

int main()
{
	fio
	int test;
	test=1;
	while(test--)
	{
		ll n,sum=0;
		cin>>n;
		vector<ll> a(n);
		for(ll i=0;i<n;i++)
		{
			cin>>a[i];
			sum+=a[i];
		}
		if(sum%2!=0)
		{
			cout<<"NO";
		}
		else
		{
			sort(a.begin(),a.end());
			if(a[n-1]>accumulate(a.begin(),a.begin()+n-1,0))
			cout<<"NO";
			else
			cout<<"YES";
		}
	}
	return 0;
}


#include <bits/stdc++.h>

using namespace std;
#define M 998244353
#define ll long long
#define fio ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
bool isSubsetSum(vector<ll> b, ll n, ll sum)
{
   // Base Cases
   if (sum == 0)
     return true;
   if (n == 0 && sum != 0)
     return false;

   // If last element is greater than sum, then ignore it
   if (b[n-1] > sum)
     return isSubsetSum(b, n-1, sum);

   /* else, check if sum can be obtained by any of the following
      (a) including the last element
      (b) excluding the last element   */
   return isSubsetSum(b, n-1, sum) ||
                        isSubsetSum(b, n-1, sum-b[n-1]);
}
int main()
{
	fio
	int test;
	test=1;
	while(test--)
	{
		ll n,sum=0;
		cin>>n;
		vector<ll> a(n);
		for(ll i=0;i<n;i++)
		{
			cin>>a[i];
			sum+=a[i];
		}
		if(sum%2!=0)
		{
			cout<<"NO";
		}
		else
		{
			vector<ll> b;
			for(ll i=0;i<n;i++)
			{
				for(ll j=i+1;j<n;j++)
				b.push_back(a[j]-a[i]);

			}
			sum=sum/2;
				if(isSubsetSum(b,b.size(),sum))
				cout<<"YES";
				else
				cout<<"NO";
		}
	}
	return 0;
}


#include <bits/stdc++.h>

using namespace std;
#define M 998244353
#define ll long long
#define fio ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);

int main()
{
	fio
	int test;
	test=1;
	while(test--)
	{
		ll n,sum=0;
		cin>>n;
		vector<ll> a(n);
		for(ll i=0;i<n;i++)
		{
			cin>>a[i];
			sum+=a[i];
		}
		if(sum%2!=0)
		{
			cout<<"NO";
		}
		else
		{
			sort(a.begin(),a.end());
			if(a[n-1]>sum-a[n-1])
			cout<<"NO";
			else
			cout<<"YES";
		}
	}
	return 0;
}


#include <bits/stdc++.h>

using namespace std;
#define M 998244353
#define ll long long
#define fio ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);

int main()
{
	fio
	int test;
	test=1;
	while(test--)
	{
		ll n,sum=0;
		cin>>n;
		vector<ll> a(n);
		for(ll i=0;i<n;i++)
		{
			cin>>a[i];
			sum+=a[i];
		}
		if(sum%2!=0)
		{
			cout<<"NO";
		}
		else
		{
			cout<<"YES";
		}
	}
	return 0;
}


#include <bits/stdc++.h>

using namespace std;
#define M 998244353
#define ll long long
#define fio ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
bool isSubsetSum(vector<ll> a, ll n, ll sum)
{
   // Base Cases
   if (sum == 0)
     return true;
   if (n == 0 && sum != 0)
     return false;

   // If last element is greater than sum, then ignore it
   if (a[n-1] > sum)
     return isSubsetSum(a, n-1, sum);

   /* else, check if sum can be obtained by any of the following
      (a) including the last element
      (b) excluding the last element   */
   return isSubsetSum(a, n-1, sum) ||
                        isSubsetSum(a, n-1, sum-a[n-1]);
}
int main()
{
	fio
	int test;
	test=1;
	while(test--)
	{
		ll n,sum=0;
		cin>>n;
		vector<ll> a(n);
		for(ll i=0;i<n;i++)
		{
			cin>>a[i];
			sum+=a[i];
		}
		if(sum%2!=0)
		{
			cout<<"NO";
		}
		else
		{
			sum=sum/2;
			if(isSubsetSum(a,n,sum))
			cout<<"YES";
			else
			cout<<"NO";
		}
	}
	return 0;
}


#include <bits/stdc++.h>

using namespace std;
#define M 998244353
#define ll long long
#define fio ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);

int main()
{
	fio
	int test;
	test=1;
	while(test--)
	{
		ll n,sum=0;
		cin>>n;
		vector<ll> a(n);
		for(ll i=0;i<n;i++)
		{
			cin>>a[i];
			sum+=a[i];
		}
		if(sum%2!=0)
		{
			cout<<"NO";
		}
		else
		{
			for(ll i=0;i<n-1;i++)
			{
				if(a[i+1]-a[i]>2)
				{
					cout<<"NO";
					return 0;
				}
			}
			cout<<"YES";
		}
	}
	return 0;
}


#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp> // Common file
#include <ext/pb_ds/tree_policy.hpp> // Including tree_order_statistics_node_update
#define ff first
#define ss second
#define pb push_back
#define pf push_front
#define eb emplace_back
#define emp emplace
#define ins insert
#define mp make_pair
#define mt make_tuple
#define sz(s) (int)s.size()
#define forp(i,a,b) for( int i=a;i<=b;i++)
#define rep(i,n)    for( int i=0;i<n;i++)
#define ren(i,n)    for( int i=n-1;i>=0;i--)
#define forn(i,a,b) for( int i=a;i>=b;i--)
#define w(t) while(t)
#define sc(a) scanf("%d", &a);
#define on cout<<"\n"
#define os cout <<" "
#define o2(a,b) cout<<a<<" "<<b
#define o(a) cout << a
#define ppr(a) cout << a.first << " " << a.second
#define bitcount __builtin_popcount
#define gcd __gcd
#define all(v) v.begin(),v.end()
#define mem(n,m) memset(n,m,sizeof(n))
#define pii pair<int,int>
#define tiii tuple<int, int, int>
#define pll pair<long long,long long>
#define sii set<int>
#define sll set<long long>
#define vii vector<int>
#define vll vector<long long>
#define mii map<int,int>
#define mll map<long long, long long>
#define lob lower_bound
#define upb upper_bound
#define ret return
#define present(s,x) (s.find(x) != s.end())
#define cpresent(s,x) (find(all(s),x) != s.end())
#define ford(container, it) for(auto it = container.begin(); it != container.end(); it++)
#define fors(container, it, a, b) for(auto it = a; it != b; it++)
using namespace __gnu_pbds;
#define boost ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define MOD 1000000007
#define EPSILON 1e-9
#define PI acos(-1)
#define inf 1e18
#define int long long
#define debug(a) cerr<<#a<<": ";for(auto i:a)cerr<<i<<" ";cerr<<'\n';
#define trace(a) cerr<<#a<<": "<<a<<"\n"
#define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update>

typedef long long  ll;
typedef long double  ldo;
typedef double  db ;
using namespace std;
auto start = std::chrono::system_clock::now();
inline void skj()
{
  std::chrono::time_point<std::chrono::system_clock> end;
  end = std::chrono::system_clock::now();
  std::chrono::duration<double> elapsed_seconds = end - start;
  std::time_t end_time = std::chrono::system_clock::to_time_t(end);
  cerr<<"Time taken " << elapsed_seconds.count()*1000<<"\n";
}

mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
//uniform_int_distribution<int> ud(1, 100); use this for random number generator

    //custom hash for unordered map
struct custom_hash {
    static uint64_t splitmix64(uint64_t x) {
        // http://xorshift.di.unimi.it/splitmix64.c
        x += 0x9e3779b97f4a7c15;
        x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9;
        x = (x ^ (x >> 27)) * 0x94d049bb133111eb;
        return x ^ (x >> 31);
    }

    size_t operator()(uint64_t x) const {
        static const uint64_t FIXED_RANDOM = chrono::steady_clock::now().time_since_epoch().count();
        return splitmix64(x + FIXED_RANDOM);
    }
};
inline int binexp(int a,int b,int m)
{
    int res=1;
    a%=m;
    while(b)
    {
        if(b&1)
            res=(res*1ll*a)%m;
        a=(a*1ll*a)%m;
        b>>=1;
    }
    return res;
}
inline void solve_me_senpai() {
   int n;
   cin >> n;
   vii arr(n);
   multiset<int> ms;
   rep(i, n) {cin >> arr[i]; ms.insert(arr[i]);}
   w((sz(ms) > 1)) {
        int f = *ms.begin();
        int l = *ms.end();
        ms.erase(ms.begin());
        ms.erase(ms.end());
        l -= f;
        if(l) {
            ms.ins(l);
        }
   }
   if(sz(ms) == 0) {
    o("YES");
   }
   else {
    o("NO");
   }
}
signed main()
{
    boost
    int t = 1;
    //cin >> t;
    //int a = 1;
    while(t--) {
        //cout << "Case #" << a  << ": ";
        solve_me_senpai();
        //a++;
    }
    //skj();
    return 0;
}


#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp> // Common file
#include <ext/pb_ds/tree_policy.hpp> // Including tree_order_statistics_node_update
#define ff first
#define ss second
#define pb push_back
#define pf push_front
#define eb emplace_back
#define emp emplace
#define ins insert
#define mp make_pair
#define mt make_tuple
#define sz(s) (int)s.size()
#define forp(i,a,b) for( int i=a;i<=b;i++)
#define rep(i,n)    for( int i=0;i<n;i++)
#define ren(i,n)    for( int i=n-1;i>=0;i--)
#define forn(i,a,b) for( int i=a;i>=b;i--)
#define w(t) while(t)
#define sc(a) scanf("%d", &a);
#define on cout<<"\n"
#define os cout <<" "
#define o2(a,b) cout<<a<<" "<<b
#define o(a) cout << a
#define ppr(a) cout << a.first << " " << a.second
#define bitcount __builtin_popcount
#define gcd __gcd
#define all(v) v.begin(),v.end()
#define mem(n,m) memset(n,m,sizeof(n))
#define pii pair<int,int>
#define tiii tuple<int, int, int>
#define pll pair<long long,long long>
#define sii set<int>
#define sll set<long long>
#define vii vector<int>
#define vll vector<long long>
#define mii map<int,int>
#define mll map<long long, long long>
#define lob lower_bound
#define upb upper_bound
#define ret return
#define present(s,x) (s.find(x) != s.end())
#define cpresent(s,x) (find(all(s),x) != s.end())
#define ford(container, it) for(auto it = container.begin(); it != container.end(); it++)
#define fors(container, it, a, b) for(auto it = a; it != b; it++)
using namespace __gnu_pbds;
#define boost ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define MOD 1000000007
#define EPSILON 1e-9
#define PI acos(-1)
#define inf 1e18
#define int long long
#define debug(a) cerr<<#a<<": ";for(auto i:a)cerr<<i<<" ";cerr<<'\n';
#define trace(a) cerr<<#a<<": "<<a<<"\n"
#define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update>

typedef long long  ll;
typedef long double  ldo;
typedef double  db ;
using namespace std;
auto start = std::chrono::system_clock::now();
inline void skj()
{
  std::chrono::time_point<std::chrono::system_clock> end;
  end = std::chrono::system_clock::now();
  std::chrono::duration<double> elapsed_seconds = end - start;
  std::time_t end_time = std::chrono::system_clock::to_time_t(end);
  cerr<<"Time taken " << elapsed_seconds.count()*1000<<"\n";
}

mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
//uniform_int_distribution<int> ud(1, 100); use this for random number generator

    //custom hash for unordered map
struct custom_hash {
    static uint64_t splitmix64(uint64_t x) {
        // http://xorshift.di.unimi.it/splitmix64.c
        x += 0x9e3779b97f4a7c15;
        x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9;
        x = (x ^ (x >> 27)) * 0x94d049bb133111eb;
        return x ^ (x >> 31);
    }

    size_t operator()(uint64_t x) const {
        static const uint64_t FIXED_RANDOM = chrono::steady_clock::now().time_since_epoch().count();
        return splitmix64(x + FIXED_RANDOM);
    }
};
inline int binexp(int a,int b,int m)
{
    int res=1;
    a%=m;
    while(b)
    {
        if(b&1)
            res=(res*1ll*a)%m;
        a=(a*1ll*a)%m;
        b>>=1;
    }
    return res;
}
inline void solve_me_senpai() {
   int n;
   cin >> n;
   vii arr(n);
   rep(i, n) cin >> arr[i];
   int rem = 0;
   ren(i, n - 1) {
        if(rem == 0) {
            rem = arr[i];
        }
        else if(rem >= arr[i] ) {
            rem -= arr[i];
        }
        else {
            rem = arr[i] - rem;
        }
   }
   o((rem == 0 ? "YES" : "NO"));
}
signed main()
{
    boost
    int t = 1;
    //cin >> t;
    //int a = 1;
    while(t--) {
        //cout << "Case #" << a  << ": ";
        solve_me_senpai();
        //a++;
    }
    //skj();
    return 0;
}


#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp> // Common file
#include <ext/pb_ds/tree_policy.hpp> // Including tree_order_statistics_node_update
#define ff first
#define ss second
#define pb push_back
#define pf push_front
#define eb emplace_back
#define emp emplace
#define ins insert
#define mp make_pair
#define mt make_tuple
#define sz(s) (int)s.size()
#define forp(i,a,b) for( int i=a;i<=b;i++)
#define rep(i,n)    for( int i=0;i<n;i++)
#define ren(i,n)    for( int i=n-1;i>=0;i--)
#define forn(i,a,b) for( int i=a;i>=b;i--)
#define w(t) while(t)
#define sc(a) scanf("%d", &a);
#define on cout<<"\n"
#define os cout <<" "
#define o2(a,b) cout<<a<<" "<<b
#define o(a) cout << a
#define ppr(a) cout << a.first << " " << a.second
#define bitcount __builtin_popcount
#define gcd __gcd
#define all(v) v.begin(),v.end()
#define mem(n,m) memset(n,m,sizeof(n))
#define pii pair<int,int>
#define tiii tuple<int, int, int>
#define pll pair<long long,long long>
#define sii set<int>
#define sll set<long long>
#define vii vector<int>
#define vll vector<long long>
#define mii map<int,int>
#define mll map<long long, long long>
#define lob lower_bound
#define upb upper_bound
#define ret return
#define present(s,x) (s.find(x) != s.end())
#define cpresent(s,x) (find(all(s),x) != s.end())
#define ford(container, it) for(auto it = container.begin(); it != container.end(); it++)
#define fors(container, it, a, b) for(auto it = a; it != b; it++)
using namespace __gnu_pbds;
#define boost ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define MOD 1000000007
#define EPSILON 1e-9
#define PI acos(-1)
#define inf 1e18
#define int long long
#define debug(a) cerr<<#a<<": ";for(auto i:a)cerr<<i<<" ";cerr<<'\n';
#define trace(a) cerr<<#a<<": "<<a<<"\n"
#define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update>

typedef long long  ll;
typedef long double  ldo;
typedef double  db ;
using namespace std;
auto start = std::chrono::system_clock::now();
inline void skj()
{
  std::chrono::time_point<std::chrono::system_clock> end;
  end = std::chrono::system_clock::now();
  std::chrono::duration<double> elapsed_seconds = end - start;
  std::time_t end_time = std::chrono::system_clock::to_time_t(end);
  cerr<<"Time taken " << elapsed_seconds.count()*1000<<"\n";
}

mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
//uniform_int_distribution<int> ud(1, 100); use this for random number generator

    //custom hash for unordered map
struct custom_hash {
    static uint64_t splitmix64(uint64_t x) {
        // http://xorshift.di.unimi.it/splitmix64.c
        x += 0x9e3779b97f4a7c15;
        x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9;
        x = (x ^ (x >> 27)) * 0x94d049bb133111eb;
        return x ^ (x >> 31);
    }

    size_t operator()(uint64_t x) const {
        static const uint64_t FIXED_RANDOM = chrono::steady_clock::now().time_since_epoch().count();
        return splitmix64(x + FIXED_RANDOM);
    }
};
inline int binexp(int a,int b,int m)
{
    int res=1;
    a%=m;
    while(b)
    {
        if(b&1)
            res=(res*1ll*a)%m;
        a=(a*1ll*a)%m;
        b>>=1;
    }
    return res;
}
inline void solve_me_senpai() {
   int n;
   cin >> n;
   vii arr(n);
   multiset<int> ms;
   rep(i, n) {cin >> arr[i]; ms.insert(-arr[i]);}
   w((sz(ms) > 1)) {
        int f = - *ms.begin();
        ms.erase(ms.begin());
        int l = - *ms.begin();
        ms.erase(ms.begin());
        l -= f;
        //cout << sz(ms) << "\n";
        //ret;
        if(l) {
            ms.ins(-l);
        }
   }
   if(sz(ms) == 0) {
    o("YES");
   }
   else {
    o("NO");
   }
}
signed main()
{
    boost
    int t = 1;
    //cin >> t;
    //int a = 1;
    while(t--) {
        //cout << "Case #" << a  << ": ";
        solve_me_senpai();
        //a++;
    }
    //skj();
    return 0;
}


#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp> // Common file
#include <ext/pb_ds/tree_policy.hpp> // Including tree_order_statistics_node_update
#define ff first
#define ss second
#define pb push_back
#define pf push_front
#define eb emplace_back
#define emp emplace
#define ins insert
#define mp make_pair
#define mt make_tuple
#define sz(s) (int)s.size()
#define forp(i,a,b) for( int i=a;i<=b;i++)
#define rep(i,n)    for( int i=0;i<n;i++)
#define ren(i,n)    for( int i=n-1;i>=0;i--)
#define forn(i,a,b) for( int i=a;i>=b;i--)
#define w(t) while(t)
#define sc(a) scanf("%d", &a);
#define on cout<<"\n"
#define os cout <<" "
#define o2(a,b) cout<<a<<" "<<b
#define o(a) cout << a
#define ppr(a) cout << a.first << " " << a.second
#define bitcount __builtin_popcount
#define gcd __gcd
#define all(v) v.begin(),v.end()
#define mem(n,m) memset(n,m,sizeof(n))
#define pii pair<int,int>
#define tiii tuple<int, int, int>
#define pll pair<long long,long long>
#define sii set<int>
#define sll set<long long>
#define vii vector<int>
#define vll vector<long long>
#define mii map<int,int>
#define mll map<long long, long long>
#define lob lower_bound
#define upb upper_bound
#define ret return
#define present(s,x) (s.find(x) != s.end())
#define cpresent(s,x) (find(all(s),x) != s.end())
#define ford(container, it) for(auto it = container.begin(); it != container.end(); it++)
#define fors(container, it, a, b) for(auto it = a; it != b; it++)
using namespace __gnu_pbds;
#define boost ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define MOD 1000000007
#define EPSILON 1e-9
#define PI acos(-1)
#define inf 1e18
#define int long long
#define debug(a) cerr<<#a<<": ";for(auto i:a)cerr<<i<<" ";cerr<<'\n';
#define trace(a) cerr<<#a<<": "<<a<<"\n"
#define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update>

typedef long long  ll;
typedef long double  ldo;
typedef double  db ;
using namespace std;
auto start = std::chrono::system_clock::now();
inline void skj()
{
  std::chrono::time_point<std::chrono::system_clock> end;
  end = std::chrono::system_clock::now();
  std::chrono::duration<double> elapsed_seconds = end - start;
  std::time_t end_time = std::chrono::system_clock::to_time_t(end);
  cerr<<"Time taken " << elapsed_seconds.count()*1000<<"\n";
}

mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
//uniform_int_distribution<int> ud(1, 100); use this for random number generator

    //custom hash for unordered map
struct custom_hash {
    static uint64_t splitmix64(uint64_t x) {
        // http://xorshift.di.unimi.it/splitmix64.c
        x += 0x9e3779b97f4a7c15;
        x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9;
        x = (x ^ (x >> 27)) * 0x94d049bb133111eb;
        return x ^ (x >> 31);
    }

    size_t operator()(uint64_t x) const {
        static const uint64_t FIXED_RANDOM = chrono::steady_clock::now().time_since_epoch().count();
        return splitmix64(x + FIXED_RANDOM);
    }
};
inline int binexp(int a,int b,int m)
{
    int res=1;
    a%=m;
    while(b)
    {
        if(b&1)
            res=(res*1ll*a)%m;
        a=(a*1ll*a)%m;
        b>>=1;
    }
    return res;
}
inline void solve_me_senpai() {
   int n;
   cin >> n;
   vii arr(n);
   multiset<int> ms;
   rep(i, n) {cin >> arr[i]; ms.insert(arr[i]);}
   w((sz(ms) > 1)) {
        int f = *ms.begin();
        int l = *(--ms.begin());
        ms.erase(ms.begin());
        ms.erase(--ms.begin());
        l -= f;
        if(l) {
            ms.ins(l);
        }
   }
   if(sz(ms) == 0) {
    o("YES");
   }
   else {
    o("NO");
   }
}
signed main()
{
    boost
    int t = 1;
    //cin >> t;
    //int a = 1;
    while(t--) {
        //cout << "Case #" << a  << ": ";
        solve_me_senpai();
        //a++;
    }
    //skj();
    return 0;
}


#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp> // Common file
#include <ext/pb_ds/tree_policy.hpp> // Including tree_order_statistics_node_update
#define ff first
#define ss second
#define pb push_back
#define pf push_front
#define eb emplace_back
#define emp emplace
#define ins insert
#define mp make_pair
#define mt make_tuple
#define sz(s) (int)s.size()
#define forp(i,a,b) for( int i=a;i<=b;i++)
#define rep(i,n)    for( int i=0;i<n;i++)
#define ren(i,n)    for( int i=n-1;i>=0;i--)
#define forn(i,a,b) for( int i=a;i>=b;i--)
#define w(t) while(t)
#define sc(a) scanf("%d", &a);
#define on cout<<"\n"
#define os cout <<" "
#define o2(a,b) cout<<a<<" "<<b
#define o(a) cout << a
#define ppr(a) cout << a.first << " " << a.second
#define bitcount __builtin_popcount
#define gcd __gcd
#define all(v) v.begin(),v.end()
#define mem(n,m) memset(n,m,sizeof(n))
#define pii pair<int,int>
#define tiii tuple<int, int, int>
#define pll pair<long long,long long>
#define sii set<int>
#define sll set<long long>
#define vii vector<int>
#define vll vector<long long>
#define mii map<int,int>
#define mll map<long long, long long>
#define lob lower_bound
#define upb upper_bound
#define ret return
#define present(s,x) (s.find(x) != s.end())
#define cpresent(s,x) (find(all(s),x) != s.end())
#define ford(container, it) for(auto it = container.begin(); it != container.end(); it++)
#define fors(container, it, a, b) for(auto it = a; it != b; it++)
using namespace __gnu_pbds;
#define boost ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define MOD 1000000007
#define EPSILON 1e-9
#define PI acos(-1)
#define inf 1e18
#define int long long
#define debug(a) cerr<<#a<<": ";for(auto i:a)cerr<<i<<" ";cerr<<'\n';
#define trace(a) cerr<<#a<<": "<<a<<"\n"
#define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update>

typedef long long  ll;
typedef long double  ldo;
typedef double  db ;
using namespace std;
auto start = std::chrono::system_clock::now();
inline void skj()
{
  std::chrono::time_point<std::chrono::system_clock> end;
  end = std::chrono::system_clock::now();
  std::chrono::duration<double> elapsed_seconds = end - start;
  std::time_t end_time = std::chrono::system_clock::to_time_t(end);
  cerr<<"Time taken " << elapsed_seconds.count()*1000<<"\n";
}

mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
//uniform_int_distribution<int> ud(1, 100); use this for random number generator

    //custom hash for unordered map
struct custom_hash {
    static uint64_t splitmix64(uint64_t x) {
        // http://xorshift.di.unimi.it/splitmix64.c
        x += 0x9e3779b97f4a7c15;
        x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9;
        x = (x ^ (x >> 27)) * 0x94d049bb133111eb;
        return x ^ (x >> 31);
    }

    size_t operator()(uint64_t x) const {
        static const uint64_t FIXED_RANDOM = chrono::steady_clock::now().time_since_epoch().count();
        return splitmix64(x + FIXED_RANDOM);
    }
};
inline int binexp(int a,int b,int m)
{
    int res=1;
    a%=m;
    while(b)
    {
        if(b&1)
            res=(res*1ll*a)%m;
        a=(a*1ll*a)%m;
        b>>=1;
    }
    return res;
}
inline void solve_me_senpai() {
   int n;
   cin >> n;
   vii arr(n);
   multiset<int> ms;
   rep(i, n) {cin >> arr[i]; ms.insert(arr[i]);}
   w((sz(ms) > 1)) {
        int f = *ms.begin();
        int l = *(++ms.begin());
        ms.erase(ms.begin());
        ms.erase(++ms.begin());
        l -= f;
        if(l) {
            ms.ins(l);
        }
   }
   if(sz(ms) == 0) {
    o("YES");
   }
   else {
    o("NO");
   }
}
signed main()
{
    boost
    int t = 1;
    //cin >> t;
    //int a = 1;
    while(t--) {
        //cout << "Case #" << a  << ": ";
        solve_me_senpai();
        //a++;
    }
    //skj();
    return 0;
}


#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp> // Common file
#include <ext/pb_ds/tree_policy.hpp> // Including tree_order_statistics_node_update
#define ff first
#define ss second
#define pb push_back
#define pf push_front
#define eb emplace_back
#define emp emplace
#define ins insert
#define mp make_pair
#define mt make_tuple
#define sz(s) (int)s.size()
#define forp(i,a,b) for( int i=a;i<=b;i++)
#define rep(i,n)    for( int i=0;i<n;i++)
#define ren(i,n)    for( int i=n-1;i>=0;i--)
#define forn(i,a,b) for( int i=a;i>=b;i--)
#define w(t) while(t)
#define sc(a) scanf("%d", &a);
#define on cout<<"\n"
#define os cout <<" "
#define o2(a,b) cout<<a<<" "<<b
#define o(a) cout << a
#define ppr(a) cout << a.first << " " << a.second
#define bitcount __builtin_popcount
#define gcd __gcd
#define all(v) v.begin(),v.end()
#define mem(n,m) memset(n,m,sizeof(n))
#define pii pair<int,int>
#define tiii tuple<int, int, int>
#define pll pair<long long,long long>
#define sii set<int>
#define sll set<long long>
#define vii vector<int>
#define vll vector<long long>
#define mii map<int,int>
#define mll map<long long, long long>
#define lob lower_bound
#define upb upper_bound
#define ret return
#define present(s,x) (s.find(x) != s.end())
#define cpresent(s,x) (find(all(s),x) != s.end())
#define ford(container, it) for(auto it = container.begin(); it != container.end(); it++)
#define fors(container, it, a, b) for(auto it = a; it != b; it++)
using namespace __gnu_pbds;
#define boost ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define MOD 1000000007
#define EPSILON 1e-9
#define PI acos(-1)
#define inf 1e18
#define int long long
#define debug(a) cerr<<#a<<": ";for(auto i:a)cerr<<i<<" ";cerr<<'\n';
#define trace(a) cerr<<#a<<": "<<a<<"\n"
#define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update>

typedef long long  ll;
typedef long double  ldo;
typedef double  db ;
using namespace std;
auto start = std::chrono::system_clock::now();
inline void skj()
{
  std::chrono::time_point<std::chrono::system_clock> end;
  end = std::chrono::system_clock::now();
  std::chrono::duration<double> elapsed_seconds = end - start;
  std::time_t end_time = std::chrono::system_clock::to_time_t(end);
  cerr<<"Time taken " << elapsed_seconds.count()*1000<<"\n";
}

mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
//uniform_int_distribution<int> ud(1, 100); use this for random number generator

    //custom hash for unordered map
struct custom_hash {
    static uint64_t splitmix64(uint64_t x) {
        // http://xorshift.di.unimi.it/splitmix64.c
        x += 0x9e3779b97f4a7c15;
        x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9;
        x = (x ^ (x >> 27)) * 0x94d049bb133111eb;
        return x ^ (x >> 31);
    }

    size_t operator()(uint64_t x) const {
        static const uint64_t FIXED_RANDOM = chrono::steady_clock::now().time_since_epoch().count();
        return splitmix64(x + FIXED_RANDOM);
    }
};
inline int binexp(int a,int b,int m)
{
    int res=1;
    a%=m;
    while(b)
    {
        if(b&1)
            res=(res*1ll*a)%m;
        a=(a*1ll*a)%m;
        b>>=1;
    }
    return res;
}
inline void solve_me_senpai() {
   int n;
   cin >> n;
   vii arr(n);
   multiset<int> ms;
   rep(i, n) {cin >> arr[i]; ms.insert(arr[i]);}
   w((sz(ms) > 1)) {
        int f = *ms.begin();
        int l = *(--ms.end());
        ms.erase(ms.begin());
        ms.erase(--ms.end());
        l -= f;
        if(l) {
            ms.ins(l);
        }
   }
   if(sz(ms) == 0) {
    o("YES");
   }
   else {
    o("NO");
   }
}
signed main()
{
    boost
    int t = 1;
    //cin >> t;
    //int a = 1;
    while(t--) {
        //cout << "Case #" << a  << ": ";
        solve_me_senpai();
        //a++;
    }
    //skj();
    return 0;
}


#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp> // Common file
#include <ext/pb_ds/tree_policy.hpp> // Including tree_order_statistics_node_update
#define ff first
#define ss second
#define pb push_back
#define pf push_front
#define eb emplace_back
#define emp emplace
#define ins insert
#define mp make_pair
#define mt make_tuple
#define sz(s) (int)s.size()
#define forp(i,a,b) for( int i=a;i<=b;i++)
#define rep(i,n)    for( int i=0;i<n;i++)
#define ren(i,n)    for( int i=n-1;i>=0;i--)
#define forn(i,a,b) for( int i=a;i>=b;i--)
#define w(t) while(t)
#define sc(a) scanf("%d", &a);
#define on cout<<"\n"
#define os cout <<" "
#define o2(a,b) cout<<a<<" "<<b
#define o(a) cout << a
#define ppr(a) cout << a.first << " " << a.second
#define bitcount __builtin_popcount
#define gcd __gcd
#define all(v) v.begin(),v.end()
#define mem(n,m) memset(n,m,sizeof(n))
#define pii pair<int,int>
#define tiii tuple<int, int, int>
#define pll pair<long long,long long>
#define sii set<int>
#define sll set<long long>
#define vii vector<int>
#define vll vector<long long>
#define mii map<int,int>
#define mll map<long long, long long>
#define lob lower_bound
#define upb upper_bound
#define ret return
#define present(s,x) (s.find(x) != s.end())
#define cpresent(s,x) (find(all(s),x) != s.end())
#define ford(container, it) for(auto it = container.begin(); it != container.end(); it++)
#define fors(container, it, a, b) for(auto it = a; it != b; it++)
using namespace __gnu_pbds;
#define boost ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define MOD 1000000007
#define EPSILON 1e-9
#define PI acos(-1)
#define inf 1e18
#define int long long
#define debug(a) cerr<<#a<<": ";for(auto i:a)cerr<<i<<" ";cerr<<'\n';
#define trace(a) cerr<<#a<<": "<<a<<"\n"
#define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update>

typedef long long  ll;
typedef long double  ldo;
typedef double  db ;
using namespace std;
auto start = std::chrono::system_clock::now();
inline void skj()
{
  std::chrono::time_point<std::chrono::system_clock> end;
  end = std::chrono::system_clock::now();
  std::chrono::duration<double> elapsed_seconds = end - start;
  std::time_t end_time = std::chrono::system_clock::to_time_t(end);
  cerr<<"Time taken " << elapsed_seconds.count()*1000<<"\n";
}

mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
//uniform_int_distribution<int> ud(1, 100); use this for random number generator

    //custom hash for unordered map
struct custom_hash {
    static uint64_t splitmix64(uint64_t x) {
        // http://xorshift.di.unimi.it/splitmix64.c
        x += 0x9e3779b97f4a7c15;
        x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9;
        x = (x ^ (x >> 27)) * 0x94d049bb133111eb;
        return x ^ (x >> 31);
    }

    size_t operator()(uint64_t x) const {
        static const uint64_t FIXED_RANDOM = chrono::steady_clock::now().time_since_epoch().count();
        return splitmix64(x + FIXED_RANDOM);
    }
};
inline int binexp(int a,int b,int m)
{
    int res=1;
    a%=m;
    while(b)
    {
        if(b&1)
            res=(res*1ll*a)%m;
        a=(a*1ll*a)%m;
        b>>=1;
    }
    return res;
}
inline void solve_me_senpai() {
   int n;
   cin >> n;
   vii arr(n);
   rep(i, n) cin >> arr[i];
   int rem = arr[n - 1];
   ren(i, n - 1) {
        if(rem == 0) {
            rem = arr[i];
        }
        else if(rem >= arr[i] ) {
            rem -= arr[i];
        }
        else {
            rem = arr[i] - rem;
        }
   }
   o((rem == 0 ? "YES" : "NO"));
}
signed main()
{
    boost
    int t = 1;
    //cin >> t;
    //int a = 1;
    while(t--) {
        //cout << "Case #" << a  << ": ";
        solve_me_senpai();
        //a++;
    }
    //skj();
    return 0;
}


#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp> // Common file
#include <ext/pb_ds/tree_policy.hpp> // Including tree_order_statistics_node_update
#define ff first
#define ss second
#define pb push_back
#define pf push_front
#define eb emplace_back
#define emp emplace
#define ins insert
#define mp make_pair
#define mt make_tuple
#define sz(s) (int)s.size()
#define forp(i,a,b) for( int i=a;i<=b;i++)
#define rep(i,n)    for( int i=0;i<n;i++)
#define ren(i,n)    for( int i=n-1;i>=0;i--)
#define forn(i,a,b) for( int i=a;i>=b;i--)
#define w(t) while(t)
#define sc(a) scanf("%d", &a);
#define on cout<<"\n"
#define os cout <<" "
#define o2(a,b) cout<<a<<" "<<b
#define o(a) cout << a
#define ppr(a) cout << a.first << " " << a.second
#define bitcount __builtin_popcount
#define gcd __gcd
#define all(v) v.begin(),v.end()
#define mem(n,m) memset(n,m,sizeof(n))
#define pii pair<int,int>
#define tiii tuple<int, int, int>
#define pll pair<long long,long long>
#define sii set<int>
#define sll set<long long>
#define vii vector<int>
#define vll vector<long long>
#define mii map<int,int>
#define mll map<long long, long long>
#define lob lower_bound
#define upb upper_bound
#define ret return
#define present(s,x) (s.find(x) != s.end())
#define cpresent(s,x) (find(all(s),x) != s.end())
#define ford(container, it) for(auto it = container.begin(); it != container.end(); it++)
#define fors(container, it, a, b) for(auto it = a; it != b; it++)
using namespace __gnu_pbds;
#define boost ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define MOD 1000000007
#define EPSILON 1e-9
#define PI acos(-1)
#define inf 1e18
#define int long long
#define debug(a) cerr<<#a<<": ";for(auto i:a)cerr<<i<<" ";cerr<<'\n';
#define trace(a) cerr<<#a<<": "<<a<<"\n"
#define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update>

typedef long long  ll;
typedef long double  ldo;
typedef double  db ;
using namespace std;
auto start = std::chrono::system_clock::now();
inline void skj()
{
  std::chrono::time_point<std::chrono::system_clock> end;
  end = std::chrono::system_clock::now();
  std::chrono::duration<double> elapsed_seconds = end - start;
  std::time_t end_time = std::chrono::system_clock::to_time_t(end);
  cerr<<"Time taken " << elapsed_seconds.count()*1000<<"\n";
}

mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
//uniform_int_distribution<int> ud(1, 100); use this for random number generator

    //custom hash for unordered map
struct custom_hash {
    static uint64_t splitmix64(uint64_t x) {
        // http://xorshift.di.unimi.it/splitmix64.c
        x += 0x9e3779b97f4a7c15;
        x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9;
        x = (x ^ (x >> 27)) * 0x94d049bb133111eb;
        return x ^ (x >> 31);
    }

    size_t operator()(uint64_t x) const {
        static const uint64_t FIXED_RANDOM = chrono::steady_clock::now().time_since_epoch().count();
        return splitmix64(x + FIXED_RANDOM);
    }
};
inline int binexp(int a,int b,int m)
{
    int res=1;
    a%=m;
    while(b)
    {
        if(b&1)
            res=(res*1ll*a)%m;
        a=(a*1ll*a)%m;
        b>>=1;
    }
    return res;
}
inline void solve_me_senpai() {
   int n;
   cin >> n;
   vii arr(n);
   rep(i, n) {cin >> arr[i];}
   int sum = accumulate(all(arr), 0ll), c = 0;
   if(sum & 1) {
    o("NO");
   }
   else {
    o("YES");
   }
}
signed main()
{
    boost
    int t = 1;
    //cin >> t;
    //int a = 1;
    while(t--) {
        //cout << "Case #" << a  << ": ";
        solve_me_senpai();
        //a++;
    }
    //skj();
    return 0;
}


#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp> // Common file
#include <ext/pb_ds/tree_policy.hpp> // Including tree_order_statistics_node_update
#define ff first
#define ss second
#define pb push_back
#define pf push_front
#define eb emplace_back
#define emp emplace
#define ins insert
#define mp make_pair
#define mt make_tuple
#define sz(s) (int)s.size()
#define forp(i,a,b) for( int i=a;i<=b;i++)
#define rep(i,n)    for( int i=0;i<n;i++)
#define ren(i,n)    for( int i=n-1;i>=0;i--)
#define forn(i,a,b) for( int i=a;i>=b;i--)
#define w(t) while(t)
#define sc(a) scanf("%d", &a);
#define on cout<<"\n"
#define os cout <<" "
#define o2(a,b) cout<<a<<" "<<b
#define o(a) cout << a
#define ppr(a) cout << a.first << " " << a.second
#define bitcount __builtin_popcount
#define gcd __gcd
#define all(v) v.begin(),v.end()
#define mem(n,m) memset(n,m,sizeof(n))
#define pii pair<int,int>
#define tiii tuple<int, int, int>
#define pll pair<long long,long long>
#define sii set<int>
#define sll set<long long>
#define vii vector<int>
#define vll vector<long long>
#define mii map<int,int>
#define mll map<long long, long long>
#define lob lower_bound
#define upb upper_bound
#define ret return
#define present(s,x) (s.find(x) != s.end())
#define cpresent(s,x) (find(all(s),x) != s.end())
#define ford(container, it) for(auto it = container.begin(); it != container.end(); it++)
#define fors(container, it, a, b) for(auto it = a; it != b; it++)
using namespace __gnu_pbds;
#define boost ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define MOD 1000000007
#define EPSILON 1e-9
#define PI acos(-1)
#define inf 1e18
#define int long long
#define debug(a) cerr<<#a<<": ";for(auto i:a)cerr<<i<<" ";cerr<<'\n';
#define trace(a) cerr<<#a<<": "<<a<<"\n"
#define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update>

typedef long long  ll;
typedef long double  ldo;
typedef double  db ;
using namespace std;
auto start = std::chrono::system_clock::now();
inline void skj()
{
  std::chrono::time_point<std::chrono::system_clock> end;
  end = std::chrono::system_clock::now();
  std::chrono::duration<double> elapsed_seconds = end - start;
  std::time_t end_time = std::chrono::system_clock::to_time_t(end);
  cerr<<"Time taken " << elapsed_seconds.count()*1000<<"\n";
}

mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
//uniform_int_distribution<int> ud(1, 100); use this for random number generator

    //custom hash for unordered map
struct custom_hash {
    static uint64_t splitmix64(uint64_t x) {
        // http://xorshift.di.unimi.it/splitmix64.c
        x += 0x9e3779b97f4a7c15;
        x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9;
        x = (x ^ (x >> 27)) * 0x94d049bb133111eb;
        return x ^ (x >> 31);
    }

    size_t operator()(uint64_t x) const {
        static const uint64_t FIXED_RANDOM = chrono::steady_clock::now().time_since_epoch().count();
        return splitmix64(x + FIXED_RANDOM);
    }
};
inline int binexp(int a,int b,int m)
{
    int res=1;
    a%=m;
    while(b)
    {
        if(b&1)
            res=(res*1ll*a)%m;
        a=(a*1ll*a)%m;
        b>>=1;
    }
    return res;
}
inline void solve_me_senpai() {
   int n;
   cin >> n;
   vii arr(n);
   rep(i, n) cin >> arr[i];
   int sum = accumulate(all(arr), 0ll);
   if(sum % 2 == 0 && sum - 2 * (*max_element(all(arr))) >= 0) {
    o("YES");
   }
   else {
    o("NO");
   }
}
signed main()
{
    boost
    int t = 1;
    //cin >> t;
    //int a = 1;
    while(t--) {
        //cout << "Case #" << a  << ": ";
        solve_me_senpai();
        //a++;
    }
    //skj();
    return 0;
}


#include <bits/stdc++.h>

using namespace std;
typedef long long INT;

#define NN 100010
int a[NN];

int main() {
#ifndef ONLINE_JUDGE
	freopen("in.in", "r", stdin);
	freopen("out.out", "w", stdout);
#endif
	int n;
	scanf("%d",&n);
	for(int i=1;i<=n;i++) scanf("%d",&a[i]);
	sort(a+1,a+n+1);
	INT sum=0;
	for(int i=1;i<=n;i++) sum+=a[i];
	int x=a[n];
	for(int i=1;i<n;i++) x-=a[i];
	int ans=0;
	if(sum&1) ans=1;
	if(x>0) ans=max(ans,x);
	if(ans>0){
		puts("NO");
		return 0;
	}
  	puts("YES");
    return 0;
}


#include <bits/stdc++.h>

#define NN 210000

using namespace std;
typedef long long INT;
int a[NN];

int main() {
#ifndef ONLINE_JUDGE
	freopen("in.in", "r", stdin);
	freopen("out.out", "w", stdout);
#endif
	int n;
	cin>>n;
	for(int i=1;i<=n;i++)scanf("%d",a+i);
	sort(a+1,a+n+1);
	INT sum=0;
	for(int i=1;i<n;i++)sum+=a[i];
	if(a[n]>sum){
		puts("-1");
		return 0;
	}
	if((sum+a[n])%2==1){
		puts("-1");
		return 0;
	}
	puts("YES");
 	return 0;
}


#include <bits/stdc++.h>

#define x first
#define y second
#define mod 1000000007
#define pb push_back
#define inf 0x3f3f3f3f
#define bclz(x) (__builtin_clz(x))
#define bctz(x) (__builtin_ctz(x))

using namespace std;

typedef long long INT;
typedef pair<int, int> pii;
typedef pair<pii, int> pi3;
typedef double DO;

template<typename T, typename U> inline void smin(T &a, U b) {if (a>b) a=b;}
template<typename T, typename U> inline void smax(T &a, U b) {if (a<b) a=b;}

template<typename T> inline void gn(T &x) {char c, sg=0; while (c=getchar(), (c>'9' || c<'0') && c!='-');for((c=='-'?sg=1, c=getchar():0), x=0; c>='0' && c<='9'; c=getchar()) x=(x<<1)+(x<<3)+c-'0';if (sg) x=-x;}
template<class T, class T1>inline void gn(T &x, T1 &y) {gn(x); gn(y);}
template<class T, class T1, class T2>inline void gn(T &x, T1 &y, T2 &z) {gn(x); gn(y); gn(z);}
template<typename T> inline void print(T x) {if (x<0) {putchar('-');return print(-x);}if (x<10) {putchar('0'+x);return;} print(x/10);putchar(x%10+'0');}
template<typename T> inline void println(T x) {print(x), putchar('\n');}
template<typename T> inline void printsp(T x) {print(x), putchar(' ');}
template<class T, class T1> inline void print(T x, T1 y) {printsp(x), println(y);}
template<class T, class T1, class T2> inline void print(T x, T1 y, T2 z) {printsp(x), printsp(y), println(z);}

int power(int a, int b, int m, int ans=1) {
	for (; b; b>>=1, a=1LL*a*a%m) if (b&1) ans=1LL*ans*a%m;
	return ans;
}

#define NN 100010
int a[NN];
int n;

int main () {
#ifndef ONLINE_JUDGE
	freopen("in.in", "r", stdin);
	freopen("out.out","w",stdout);
#endif
	gn(n);
	for (int i=1; i<=n; i++) gn(a[i]);
	sort(a+1, a+n+1);
	for (int i=2; i<=n; i++) {
		if (a[i]==a[i-1]) a[i]=a[i-1]=0;
	}
	for (int i=1; i<=n; i++) if (a[i]) return puts("NO");
	puts("YES");
	return 0;
}


#include <bits/stdc++.h>

#define x first
#define y second
#define mod 1000000007
#define pb push_back
#define inf 0x3f3f3f3f
#define bclz(x) (__builtin_clz(x))
#define bctz(x) (__builtin_ctz(x))

using namespace std;

typedef long long INT;
typedef pair<int, int> pii;
typedef pair<pii, int> pi3;
typedef double DO;

template<typename T, typename U> inline void smin(T &a, U b) {if (a>b) a=b;}
template<typename T, typename U> inline void smax(T &a, U b) {if (a<b) a=b;}

template<typename T> inline void gn(T &x) {char c, sg=0; while (c=getchar(), (c>'9' || c<'0') && c!='-');for((c=='-'?sg=1, c=getchar():0), x=0; c>='0' && c<='9'; c=getchar()) x=(x<<1)+(x<<3)+c-'0';if (sg) x=-x;}
template<class T, class T1>inline void gn(T &x, T1 &y) {gn(x); gn(y);}
template<class T, class T1, class T2>inline void gn(T &x, T1 &y, T2 &z) {gn(x); gn(y); gn(z);}
template<typename T> inline void print(T x) {if (x<0) {putchar('-');return print(-x);}if (x<10) {putchar('0'+x);return;} print(x/10);putchar(x%10+'0');}
template<typename T> inline void println(T x) {print(x), putchar('\n');}
template<typename T> inline void printsp(T x) {print(x), putchar(' ');}
template<class T, class T1> inline void print(T x, T1 y) {printsp(x), println(y);}
template<class T, class T1, class T2> inline void print(T x, T1 y, T2 z) {printsp(x), printsp(y), println(z);}

int power(int a, int b, int m, int ans=1) {
	for (; b; b>>=1, a=1LL*a*a%m) if (b&1) ans=1LL*ans*a%m;
	return ans;
}

#define NN 100010
int n;
INT sum;
int a[NN];

int main () {
#ifndef ONLINE_JUDGE
	freopen("in.in", "r", stdin);
	freopen("out.out","w",stdout);
#endif
	gn(n);
	for (int i=1; i<=n; i++) gn(a[i]);
	sort(a+1, a+n+1);
	for (int i=1; i<=n; i++) sum+=a[i];
	if (sum & 1) return puts("NO");
	if (a[n]*2>sum) return puts("NO");
	puts("YES");
	return 0;
}


#include <bits/stdc++.h>
#define NN 200050
#define inf 1000050000

using namespace std;

int a[NN];
main(){
#ifndef ONLINE_JUDGE
freopen("in.in","r",stdin);
#endif // ONLINE_JUDGE

	int n,s=0;
	cin>>n;
	for(int i=1;i<=n;i++){
		cin>>a[i];
		s+=a[i];
		s%=2;
	}
	if(s)puts("NO");
	else puts("YES");

	return 0;
}


#include <bits/stdc++.h>

#define x first
#define y second
#define mod 1000000007
#define pb push_back
#define inf 0x3f3f3f3f
#define bclz(x) (__builtin_clz(x))
#define bctz(x) (__builtin_ctz(x))

using namespace std;

typedef long long INT;
typedef pair<int, int> pii;
typedef pair<pii, int> pi3;
typedef double DO;

template<typename T, typename U> inline void smin(T &a, U b) {if (a>b) a=b;}
template<typename T, typename U> inline void smax(T &a, U b) {if (a<b) a=b;}

template<typename T> inline void gn(T &x) {char c, sg=0; while (c=getchar(), (c>'9' || c<'0') && c!='-');for((c=='-'?sg=1, c=getchar():0), x=0; c>='0' && c<='9'; c=getchar()) x=(x<<1)+(x<<3)+c-'0';if (sg) x=-x;}
template<class T, class T1>inline void gn(T &x, T1 &y) {gn(x); gn(y);}
template<class T, class T1, class T2>inline void gn(T &x, T1 &y, T2 &z) {gn(x); gn(y); gn(z);}
template<typename T> inline void print(T x) {if (x<0) {putchar('-');return print(-x);}if (x<10) {putchar('0'+x);return;} print(x/10);putchar(x%10+'0');}
template<typename T> inline void println(T x) {print(x), putchar('\n');}
template<typename T> inline void printsp(T x) {print(x), putchar(' ');}
template<class T, class T1> inline void print(T x, T1 y) {printsp(x), println(y);}
template<class T, class T1, class T2> inline void print(T x, T1 y, T2 z) {printsp(x), printsp(y), println(z);}

int power(int a, int b, int m, int ans=1) {
	for (; b; b>>=1, a=1LL*a*a%m) if (b&1) ans=1LL*ans*a%m;
	return ans;
}

#define NN 100010
int a[NN];
int n;

set<int> s;
map<int, int> flag;

int main () {
#ifndef ONLINE_JUDGE
	freopen("in.in", "r", stdin);
	freopen("out.out","w",stdout);
#endif
	gn(n);
	for (int i=1; i<=n; i++) gn(a[i]);
	sort(a+1, a+n+1);

	int ans=0;
	for (int i=1; i<=n; i++) if (a[n]==a[i]) ans++;
	if (ans & 1) return puts("NO");
	puts("YES");
	return 0;
}


#include<bits/stdc++.h>

#define x first
#define y second

using namespace std;

typedef long long INT;

int power(int a, int b, int m, int ans=1) {
	for (; b; b>>=1, a=1LL*a*a%m) if (b&1) ans=1LL*ans*a%m;
	return ans;
}

int a[100010];

int main(){
#ifndef ONLINE_JUDGE
	freopen("in.in","r",stdin);
	freopen("out.out","w",stdout);
#endif
	int n;
	cin >> n;
	for(int i=1; i<=n; i++) scanf("%d", a+i);
	sort(a+1, a+n+1);
	INT sum = 0;
	for(int i=1; i<=n; i++) sum += a[i];
	if(sum % 2 != 0 || sum < a[n] * 2) return puts("NO"), 0;
	puts("YES");

	return 0;
}


#include <bits/stdc++.h>

#define x first
#define y second
#define mod 1000000007
#define pb push_back
#define inf 0x3f3f3f3f
#define bclz(x) (__builtin_clz(x))
#define bctz(x) (__builtin_ctz(x))

using namespace std;

typedef long long INT;
typedef pair<int, int> pii;
typedef pair<pii, int> pi3;
typedef double DO;

template<typename T, typename U> inline void smin(T &a, U b) {if (a>b) a=b;}
template<typename T, typename U> inline void smax(T &a, U b) {if (a<b) a=b;}

template<typename T> inline void gn(T &x) {char c, sg=0; while (c=getchar(), (c>'9' || c<'0') && c!='-');for((c=='-'?sg=1, c=getchar():0), x=0; c>='0' && c<='9'; c=getchar()) x=(x<<1)+(x<<3)+c-'0';if (sg) x=-x;}
template<class T, class T1>inline void gn(T &x, T1 &y) {gn(x); gn(y);}
template<class T, class T1, class T2>inline void gn(T &x, T1 &y, T2 &z) {gn(x); gn(y); gn(z);}
template<typename T> inline void print(T x) {if (x<0) {putchar('-');return print(-x);}if (x<10) {putchar('0'+x);return;} print(x/10);putchar(x%10+'0');}
template<typename T> inline void println(T x) {print(x), putchar('\n');}
template<typename T> inline void printsp(T x) {print(x), putchar(' ');}
template<class T, class T1> inline void print(T x, T1 y) {printsp(x), println(y);}
template<class T, class T1, class T2> inline void print(T x, T1 y, T2 z) {printsp(x), printsp(y), println(z);}

int power(int a, int b, int m, int ans=1) {
	for (; b; b>>=1, a=1LL*a*a%m) if (b&1) ans=1LL*ans*a%m;
	return ans;
}

#define NN 100010
int a[NN];
int n;

int main () {
#ifndef ONLINE_JUDGE
	freopen("in.in", "r", stdin);
	freopen("out.out","w",stdout);
#endif
	gn(n);
	for (int i=1; i<=n; i++) gn(a[i]);
	sort(a+1, a+n+1);
	int ans=0;
	for (int i=n; i>=1; i--) if (a[n]==a[i]) ans++;
	if (ans & 1) return puts("NO");
	puts("YES");
	return 0;
}


#include<bits/stdc++.h>
#define bclz(x) (__builtin_clz(x))
#define x first
#define y second
using namespace std;
typedef long long INT;
typedef vector<int> VI;
typedef pair<int,int> pii;
int a[100100];
int main(){
#ifndef ONLINE_JUDGE
	freopen("in.in","r",stdin);
	freopen("out.out","w",stdout);
#endif
	int n;
	cin>>n;
	INT s=0;
	for(int i=1;i<=n;i++) scanf("%d",a+i),s+=a[i];
	sort(a+1,a+n+1);
	s-=a[n];
	if(a[n]>s) {puts("NO");return 0;}
	s+=a[n];
	if(s%2) puts("NO");
	else puts("YES");
	return 0;
}


#include<bits/stdc++.h>

#define pb push_back
#define x first
#define y second
using namespace std;
typedef long long INT;
typedef pair<int, int> pii;
typedef vector<int> VI;
int power(int a, int b, int m, int ans=1) {
	for(; b; b>>=1, a=1LL*a*a%m) if(b&1) ans=1LL*ans*a%m;
	return ans;
}

int a[100011];

int main() {
#ifndef	ONLINE_JUDGE
	freopen("in.in", "r", stdin);
	freopen("out.out", "w", stdout);
#endif
	int n;
	cin >> n;
	int ans = 0;

	for(int i=0; i<n; i++) {
		int u;
		scanf("%d", a+i);
		ans ^= a[i]&1;
	}
	if(n % 2 == 0 and ans % 2) return puts("NO");
	if(n == 2 and a[0] != a[1]) return puts("NO");
	puts("YES");
	return 0;
}


#include <bits/stdc++.h>

using namespace std;
typedef long long INT;

#define NN 100010
int a[NN];

int main() {
#ifndef ONLINE_JUDGE
	freopen("in.in", "r", stdin);
	freopen("out.out", "w", stdout);
#endif

	int n;
	scanf("%d",&n);
	for(int i=1;i<=n;i++) scanf("%d",&a[i]);
	sort(a+1,a+n+1);
	INT sum=0;
	for(int i=1;i<=n;i++) sum+=a[i];
	INT x=a[n];
	for(int i=1;i<n;i++) x-=a[i];
	if(sum%2==1||x>0){
		puts("NO");
		return 0;
	}
	puts("YES");
	return 0;
}


#include<bits/stdc++.h>

#define pb push_back
#define x first
#define y second
using namespace std;
typedef long long INT;
typedef pair<int, int> pii;
typedef vector<int> VI;
int power(int a, int b, int m, int ans=1) {
	for(; b; b>>=1, a=1LL*a*a%m) if(b&1) ans=1LL*ans*a%m;
	return ans;
}

int a[100011];

int main() {
#ifndef	ONLINE_JUDGE
	freopen("in.in", "r", stdin);
	freopen("out.out", "w", stdout);
#endif
	int n;
	cin >> n;
	int ans = 0;
	INT sum = 0;
	for(int i=0; i<n; i++) {
		int u;
		scanf("%d", a+i);
		sum += a[i];
		ans ^= a[i]&1;
	}
	sort(a, a+n);
	sum -= a[n-1];
	if(sum < a[n-1]) return puts("NO");
	if(ans) return puts("NO");
	puts("YES");
	return 0;
}


#include <bits/stdc++.h>

#define x first
#define y second
#define mod 1000000007
#define pb push_back
#define inf 0x3f3f3f3f
#define bclz(x) (__builtin_clz(x))
#define bctz(x) (__builtin_ctz(x))

using namespace std;

typedef long long INT;
typedef pair<int, int> pii;
typedef pair<pii, int> pi3;
typedef double DO;

template<typename T, typename U> inline void smin(T &a, U b) {if (a>b) a=b;}
template<typename T, typename U> inline void smax(T &a, U b) {if (a<b) a=b;}

template<typename T> inline void gn(T &x) {char c, sg=0; while (c=getchar(), (c>'9' || c<'0') && c!='-');for((c=='-'?sg=1, c=getchar():0), x=0; c>='0' && c<='9'; c=getchar()) x=(x<<1)+(x<<3)+c-'0';if (sg) x=-x;}
template<class T, class T1>inline void gn(T &x, T1 &y) {gn(x); gn(y);}
template<class T, class T1, class T2>inline void gn(T &x, T1 &y, T2 &z) {gn(x); gn(y); gn(z);}
template<typename T> inline void print(T x) {if (x<0) {putchar('-');return print(-x);}if (x<10) {putchar('0'+x);return;} print(x/10);putchar(x%10+'0');}
template<typename T> inline void println(T x) {print(x), putchar('\n');}
template<typename T> inline void printsp(T x) {print(x), putchar(' ');}
template<class T, class T1> inline void print(T x, T1 y) {printsp(x), println(y);}
template<class T, class T1, class T2> inline void print(T x, T1 y, T2 z) {printsp(x), printsp(y), println(z);}

int power(int a, int b, int m, int ans=1) {
	for (; b; b>>=1, a=1LL*a*a%m) if (b&1) ans=1LL*ans*a%m;
	return ans;
}

#define NN 100010
int a[NN];
int n;

set<int> s;
map<int, int> flag;

int main () {
#ifndef ONLINE_JUDGE
	freopen("in.in", "r", stdin);
	freopen("out.out","w",stdout);
#endif
	gn(n);
	for (int i=1; i<=n; i++) gn(a[i]);
	sort(a+1, a+n+1);
	for (int i=1; i<=n; ) {
		int j=i;
		while (a[j]==a[i] and j<=n) j++;
		flag[a[i]]=j-i;
		i=j;
	}

	for (int i=1; i<=n; i++) s.insert(a[i]);
	for (auto v : s) {
		if (flag[v] & 1) return puts("NO");
	}
	puts("YES");

	return 0;
}


#include <bits/stdc++.h>
#define NN 200050
#define inf 1000050000

using namespace std;

int a[NN];
main(){
#ifndef ONLINE_JUDGE
freopen("in.in","r",stdin);
#endif // ONLINE_JUDGE

	int n,m,mx=0;
	long long sum=0;
	cin>>n;
	for(int i=1;i<=n;i++){
		cin>>a[i];
		sum+=a[i];
		mx=max(mx,a[i]);
	}
	if(sum&1){puts("NO");return 0;}
	if(2*mx>sum){puts("NO");return 0;}
	puts("YES");

	return 0;
}


#include <bits/stdc++.h>

#define NN 210000

using namespace std;
typedef long long INT;
int a[NN];

int main() {
#ifndef ONLINE_JUDGE
	freopen("in.in", "r", stdin);
	freopen("out.out", "w", stdout);
#endif
	int n;
	cin>>n;
	for(int i=1;i<=n;i++)scanf("%d",a+i);
	sort(a+1,a+n+1);
	INT sum=0;
	for(int i=1;i<n;i++)sum+=a[i];
	if(a[n]>sum){
		puts("-1");
		return 0;
	}
	if((sum+a[n])%2==1){
		puts("NO");
		return 0;
	}
	puts("YES");
 	return 0;
}


#include <bits/stdc++.h>
#define NN 100010
using namespace std;
typedef long long INT;
INT a[NN];
int main(){
#ifndef ONLINE_JUDGE
	freopen("in.in", "r", stdin);
	freopen("out.out", "w", stdout);
#endif
	int n;
	scanf("%d", &n);
	INT sum = 0;
	for(int i = 0; i < n; i++){
		scanf("%I64d", &a[i]);
		sum += a[i];
	}
	if(sum & 1) {puts("NO"); return 0;}
	int flag = 1;
	for(int i = 0; i < n; i++){
		if(a[i] > sum / 2) {flag = 0; break;}
	}
	if(flag == 0) puts("NO");
	else puts("YES");
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
int a[100010],aa[100010];
int main() {
#ifndef ONLINE_JUDGE
	freopen("in.in", "r", stdin);
	freopen("out.out", "w", stdout);
#endif
	int n;
	cin>>n;
	for(int i=0;i<n;i++){
		cin>>a[i];
	}
	for(int i=0;i<n;i++){
		sort(a,a+n);
		a[n-1]-=a[n-2];
		a[n-2]=0;
	}
	if(a[n-1]==0) cout<<"YES"<<endl;
	else cout<<"NO"<<endl;

	return 0;
}


#include <bits/stdc++.h>
using namespace std;
int a[100010];
int main() {
#ifndef ONLINE_JUDGE
	freopen("in.in", "r", stdin);
	freopen("out.out", "w", stdout);
#endif
	int n;
	cin>>n;
	for(int i=0;i<n;i++){
		cin>>a[i];
	}
	int s=0;
	sort(a,a+n);
	for(int i=0;i<n;i++){
		s+=a[i];
	}

	if(s%2) {cout<<"NO"<<endl;return 0;}
	if(s-a[n-1]>=a[n-1]) {cout<<"YES"<<endl;return 0;}
	cout<<"NO"<<endl;

	return 0;
}


#include <bits/stdc++.h>

#define NN 210000

using namespace std;
typedef long long INT;
int a[NN];

int main() {
#ifndef ONLINE_JUDGE
	freopen("in.in", "r", stdin);
	freopen("out.out", "w", stdout);
#endif
	int n;
	cin>>n;
	for(int i=1;i<=n;i++)scanf("%d",a+i);
	sort(a+1,a+n+1);
	INT sum=0;
	for(int i=1;i<n;i++)sum+=a[i];
	if(a[n]>sum){
		puts("NO");
		return 0;
	}
	if((sum+a[n])%2==1){
		puts("NO");
		return 0;
	}
	puts("YES");
 	return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long INT;
INT a[100010],aa[100010];
int main() {
#ifndef ONLINE_JUDGE
	freopen("in.in", "r", stdin);
	freopen("out.out", "w", stdout);
#endif
	int n;
	INT s=0;
	cin>>n;
	for(int i=0;i<n;i++){
		scanf("%lld",a+i);
		s+=a[i];
	}
	sort(a,a+n);
	if(s%2) {cout<<"NO"<<endl;return 0;}
	if(s-a[n-1]>=a[n-1]) cout<<"YES"<<endl;
	else cout<<"NO"<<endl;

	return 0;
}


#include<bits/stdc++.h>

#define pb push_back
#define x first
#define y second
using namespace std;
typedef long long INT;
typedef pair<int, int> pii;
typedef vector<int> VI;
int power(int a, int b, int m, int ans=1) {
	for(; b; b>>=1, a=1LL*a*a%m) if(b&1) ans=1LL*ans*a%m;
	return ans;
}

int a[100011];

int main() {
#ifndef	ONLINE_JUDGE
	freopen("in.in", "r", stdin);
	freopen("out.out", "w", stdout);
#endif
	int n;
	cin >> n;
	int ans = 0;

	for(int i=0; i<n; i++) {
		int u;
		scanf("%d", a+i);
		ans ^= u&1;
	}
	if(n % 2 == 0 and ans % 2) return puts("NO");
	if(n == 2 and a[0] != a[1]) return puts("NO");
	puts("YES");
	return 0;
}


#include<bits/stdc++.h>

#define pb push_back
#define x first
#define y second
using namespace std;
typedef long long INT;
typedef pair<int, int> pii;
typedef vector<int> VI;
int power(int a, int b, int m, int ans=1) {
	for(; b; b>>=1, a=1LL*a*a%m) if(b&1) ans=1LL*ans*a%m;
	return ans;
}

int main() {
#ifndef	ONLINE_JUDGE
	freopen("in.in", "r", stdin);
	freopen("out.out", "w", stdout);
#endif
	int n;
	cin >> n;
	int ans = 0;
	for(int i=0; i<n; i++) {
		int u;
		scanf("%d", &u);
		ans ^= u&1;
	}
	if(n % 2 == 0 and ans % 2) return puts("NO");
	puts("YES");
	return 0;
}


#include<bits/stdc++.h>
#define x first
#define y second

using namespace std;
using INT = long long;
using DO = double;
using pii = pair<int, int>;

int power(int a, int b, int c, int ans=1) {
	for(; b; b>>=1, a=1ll*a*a%c) if(b&1) ans=1ll*ans*a%c;
	return ans;
}

const int NN = 1e5+10;

int a[NN];

int main() {
#ifndef ONLINE_JUDGE
	freopen("in.in", "r", stdin);
	freopen("out.out", "w", stdout);
#endif
	int n;
	scanf("%d", &n);
	for(int i=0; i<n; i++) scanf("%d", a+i);
	sort(a, a+n);
	reverse(a, a+n);
	INT sum=0;
	for(int i=1; i<n; i++) sum+=a[i];
	if(a[0]>sum || ((sum+a[0])&1ll) != 0) {
		puts("NO");
		return 0;
	}
	puts("YES");

	return 0;
}


#include <bits/stdc++.h>
using namespace std;
int a[100010],aa[100010];
int main() {
#ifndef ONLINE_JUDGE
	freopen("in.in", "r", stdin);
	freopen("out.out", "w", stdout);
#endif
	int n;
	cin>>n;
	for(int i=0;i<n;i++){
		cin>>a[i];
	}
	sort(a,a+n);
	for(int i=0;i<n;i++){
		a[n-1]-=a[n-2];
		a[n-2]=0;
		sort(a,a+n);
		if(a[n-1]==0) break;
	}
	if(a[n-1]==0) cout<<"YES"<<endl;
	else cout<<"NO"<<endl;

	return 0;
}


#include <bits/stdc++.h>
using namespace std;
int a[100010],aa[100010];
int main() {
#ifndef ONLINE_JUDGE
	freopen("in.in", "r", stdin);
	freopen("out.out", "w", stdout);
#endif
	int n;
	cin>>n;
	for(int i=0;i<n;i++){
		cin>>a[i];
	}
	int s=0,k=0;
	sort(a,a+n);
	for(int i=0;i<n;i++){
		if(a[i]==a[i+1])i++;
		else aa[k++]=a[i];
	}
	for(int i=0;i<k;i++){
		s+=aa[i];
	}
	if(s%2) {cout<<"NO"<<endl;return 0;}
	if(s-aa[k-1]>=aa[k-1]) {cout<<"YES"<<endl;return 0;}
	cout<<"NO"<<endl;

	return 0;
}


#include <bits/stdc++.h>
#define NN 100010
using namespace std;
typedef long long INT;
INT a[NN];
int main(){
#ifndef ONLINE_JUDGE
	freopen("in.in", "r", stdin);
	freopen("out.out", "w", stdout);
#endif
	int n;
	scanf("%d", &n);
	INT sum = 0;
	for(int i = 0; i < n; i++){
		scanf("%I64d", &a[i]);
		sum += a[i];
	}
	if(sum & 1) puts("NO");
	else puts("YES");
	return 0;
}


#include <algorithm>
#include <iostream>

using namespace std;

int a[100000];

int main()
{
	cin.sync_with_stdio(0);
	cin.tie(0);

	int n, max_ele;
	long long sum = 0;
	cin >> n;

	for (int i = 0; i < n; i++) cin >> a[i];
	for (int i : a)
	{
		max_ele = max(max_ele, i);
		sum += i;
	}

	cout << (sum % 2 == 0 && sum >= 2 * max_ele ? "NO" : "YES") << '\n';
	return 0;
}


#include <algorithm>
#include <iostream>

using namespace std;

int a[100000];

int main()
{
	cin.sync_with_stdio(0);
	cin.tie(0);

	int n, sum = 0, max_ele;
	cin >> n;

	for (int i = 0; i < n; i++) cin >> a[i];
	for (int i : a)
	{
		max_ele = max(max_ele, i);
		sum += i;
	}

	cout << (sum % 2 == 0 && sum >= 2 * max_ele ? "YES" : "NO") << '\n';
	return 0;
}


#include <algorithm>
#include <iostream>

using namespace std;

int a[100000];

int main()
{
	cin.sync_with_stdio(0);
	cin.tie(0);

	int n, max_ele;
	long long sum = 0;
	cin >> n;

	for (int i = 0; i < n; i++) cin >> a[i];
	for (int i : a)
	{
		max_ele = max(max_ele, i);
		sum += i;
	}

	cout << (sum % 2 == 0 && sum >= 2 * max_ele ? "YES" : "NO") << '\n';
	return 0;
}


#include <algorithm>
#include <iostream>
#include <vector>

using namespace std;

int main()
{
	cin.sync_with_stdio(0);
	cin.tie(0);

	int n, min_ele;
	cin >> n;

	vector<int> a(n);
	for (int i = 0; i < n; i++) cin >> a[i];
	sort(a.begin(), a.end(), greater<int>());

	while (a.size() > 1)
	{
		min_ele = min(a[0], a[1]);
		a[0] -= min_ele, a[1] -= min_ele;

		a.erase(a.begin() + (a[1] == 0));
		a.insert(upper_bound(a.begin(), a.end(), a[0], greater<int>()), a[0]);
		a.erase(a.begin());
	}

	cout << (a[0] ? "NO" : "YES") << '\n';
	return 0;
}


#include <bits/stdc++.h>

using namespace std;

int x,y,a,b;
int N;

bool yes = false;

bool ask(int n){

    int A = a*n;
    int B = b*n;

    if(A-x <= B-y && A-x >= 0){
        yes = true;
        return true;
    }
    else {
        return false;
    }

}

int main (){

    //double x,y,a,b;

    scanf("%d",&N);

    for(int i=0; i<N; i++){
        yes = false;
        scanf("%d%d%d%d",&x,&y,&a,&b);

        int piv1 = 0;
        int piv2 = 100000;

        while(piv1 < piv2){
            int mid=(piv1+piv2)/2;
            if(ask(mid) == true){
                piv2 = mid;
            }
            else {
                piv1 = mid + 1;
            }
        }

        if(yes == false){
            printf("-1\n");
            //return 0;
        }
        else {
            printf("%d\n",(b*piv1)-y);
        }
    }

    return 0;
}


#include <bits/stdc++.h>

using namespace std;

long long x,y,a,b;
long long N;

bool yes = false;

bool ask(long long n){

    long long A = a*n;
    long long B = b*n;

    if(A-x <= B-y && A-x >= 0){
        yes = true;
        return true;
    }
    else {
        return false;
    }

}

int main (){

    //double x,y,a,b;

    scanf("%I64d",&N);

    for(int i=0; i<N; i++){
        yes = false;
        scanf("%I64d%I64d%I64d%I64d",&x,&y,&a,&b);

        long long piv1 = 0;
        long long piv2 = 20000000000;

        while(piv1 < piv2){
            long long mid=(piv1+piv2)/2;
            if(ask(mid) == true){
                piv2 = mid;
            }
            else {
                piv1 = mid + 1;
            }
        }

        if(yes == false){
            printf("-1\n");
            //return 0;
        }
        else {
            printf("%I64d\n",(b*piv1)-y);
        }
    }

    return 0;
}


#include <bits/stdc++.h>

using namespace std;

int x,y,a,b;
int N;

bool yes = false;

bool ask(int n){

    int A = a*n;
    int B = b*n;

    if(A-x <= B-y && A-x >= 0){
        yes = true;
        return true;
    }
    else {
        return false;
    }

}

int main (){

    //double x,y,a,b;

    scanf("%d",&N);

    for(int i=0; i<N; i++){
        yes = false;
        scanf("%d%d%d%d",&x,&y,&a,&b);

        int piv1 = 0;
        int piv2 = 10000000;

        while(piv1 < piv2){
            int mid=(piv1+piv2)/2;
            if(ask(mid) == true){
                piv2 = mid;
            }
            else {
                piv1 = mid + 1;
            }
        }

        if(yes == false){
            printf("-1\n");
            //return 0;
        }
        else {
            printf("%d\n",(b*piv1)-y);
        }
    }

    return 0;
}


#include <bits/stdc++.h>

using namespace std;

#define pb push_back
#define mp make_pair
#define ff first
#define ss second

typedef long long int ll;
typedef vector< pair<int, int> > vii;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<long long int> vll;
typedef pair<int, int> pii;

const ll INF = 1e18;
const int inf = 1e9;
const int MOD = 1e9 + 7;
const int nax = 1000000 + 10;

ll p, q, x, y;
bool is(ll nt)
{
    ll z = p * y + p * nt - q * x;
    z /= q;
    if(z >= 0 && z <= nt)
        return true;
    return false;
}
int main()
{
    ios::sync_with_stdio(0);

    int t; cin >> t;
    while(t--)
    {
        cin >> x >> y >> p >> q;
        ll l = 0;
        ll r = 1e18;
        ll ans = -1;

        while(r - l > 1)
        {
            ll mid = (l + r) / 2;
            if(is(mid) == true)
            {
                ans = mid;
                r = mid;
            }
            else
                l = mid;
        }
        ll mainans;
        if(ans == -1)
        {
            cout << -1 << endl;
            continue;
        }
        if(ans > 0 && is(ans - 1))
            mainans = ans - 1;
        else
            mainans = ans;
    ll temp = y + mainans;
    ll xnot;
    if(temp % q != 0)
        xnot = temp / q + 1;
    else
        xnot = temp / q;
    ll diff = q * xnot - temp;

    cout << mainans + diff << endl;

    }

    return 0;
}


#include <bits/stdc++.h>

using namespace std;

#define pb push_back
#define mp make_pair
#define ff first
#define ss second

typedef unsigned long long int ll;
typedef vector< pair<int, int> > vii;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<long long int> vll;
typedef pair<int, int> pii;

const ll INF = 1e18;
const int inf = 1e9;
const int MOD = 1e9 + 7;
const int nax = 1000000 + 10;

ll p, q, x, y;
bool is(ll nt)
{
    ll z = p * y + p * nt - q * x;
    z /= q;
    if(z >= 0 && z <= nt)
        return true;
    return false;
}
int main()
{
    ios::sync_with_stdio(0);

    int t; cin >> t;
    while(t--)
    {
        cin >> x >> y >> p >> q;

        if(p == 1 && q == 1)
        {
            cout << -1;
            continue;
        }
        if(p == 0 && x != 0)
        {
            cout << -1;
            return 0;
        }

        ll l = 0;
        ll r = 1e18;
        ll ans = -1;

        while(r - l > 1)
        {
            ll mid = (l + r) / 2;
            if(is(mid) == true)
            {
                ans = mid;
                r = mid;
            }
            else
                l = mid;
        }
        ll mainans;
        if(ans > 0 && is(ans - 1))
            mainans = ans - 1;
        else
            mainans = ans;
    ll temp = y + mainans;
    ll xnot;
    if(temp % q != 0)
        xnot = temp / q + 1;
    else
        xnot = temp / q;
    ll diff = q * xnot - temp;

    cout << mainans + diff << endl;

    }

    return 0;
}


#include <bits/stdc++.h>

using namespace std;

#define pb push_back
#define mp make_pair
#define ff first
#define ss second

typedef long long int ll;
typedef vector< pair<int, int> > vii;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<long long int> vll;
typedef pair<int, int> pii;

const ll INF = 1e18;
const int inf = 1e9;
const int MOD = 1e9 + 7;
const int nax = 1000000 + 10;

ll p, q, x, y;
bool is(ll nt)
{
    ll z = p * y + p * nt - q * x;
    z /= q;
    if(z >= 0 && z <= nt)
        return true;
    return false;
}
int main()
{
    ios::sync_with_stdio(0);

    int t; cin >> t;
    while(t--)
    {
        cin >> x >> y >> p >> q;
        ll l = 0;
        ll r = 1e10;
        ll ans = -1;

        while(r - l > 1)
        {
            ll mid = (l + r) / 2;
            if(is(mid) == true)
            {
                ans = mid;
                r = mid;
            }
            else
                l = mid;
        }
        ll mainans;
        if(ans == -1)
        {
            cout << -1 << endl;
            continue;
        }
        if(ans > 0 && is(ans - 1))
            mainans = ans - 1;
        else
            mainans = ans;
    ll temp = y + mainans;
    ll xnot;
    if(temp % q != 0)
        xnot = temp / q + 1;
    else
        xnot = temp / q;
    ll diff = q * xnot - temp;

    cout << mainans + diff << endl;

    }

    return 0;
}


#include <bits/stdc++.h>

using namespace std;

#define pb push_back
#define mp make_pair
#define ff first
#define ss second

typedef long long int ll;
typedef vector< pair<int, int> > vii;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<long long int> vll;
typedef pair<int, int> pii;

const ll INF = 1e18;
const int inf = 1e9;
const int MOD = 1e9 + 7;
const int nax = 1000000 + 10;

ll p, q, x, y;
bool is(ll nt)
{
    ll z = p * y + p * nt - q * x;
    z /= q;
    if(z >= 0 && z <= nt)
        return true;
    return false;
}
int main()
{
    ios::sync_with_stdio(0);

    int t; cin >> t;
    while(t--)
    {
        cin >> x >> y >> p >> q;
        ll l = 0;
        ll r = 1e16;
        ll ans = -1;

        while(r - l > 1)
        {
            ll mid = (l + r) / 2;
            if(is(mid) == true)
            {
                ans = mid;
                r = mid;
            }
            else
                l = mid;
        }
        ll mainans;
        if(ans == -1)
        {
            cout << -1 << endl;
            continue;
        }
        if(ans > 0 && is(ans - 1))
            mainans = ans - 1;
        else
            mainans = ans;
    ll temp = y + mainans;
    ll xnot;
    if(temp % q != 0)
        xnot = temp / q + 1;
    else
        xnot = temp / q;
    ll diff = q * xnot - temp;

    cout << mainans + diff << endl;

    }

    return 0;
}


#include <bits/stdc++.h>

using namespace std;

#define pb push_back
#define mp make_pair
#define ff first
#define ss second

typedef long long int ll;
typedef vector< pair<int, int> > vii;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<long long int> vll;
typedef pair<int, int> pii;

const ll INF = 1e18;
const int inf = 1e9;
const int MOD = 1e9 + 7;
const int nax = 1000000 + 10;

ll x, y, p, q;
ll ans;

bool is(int mid)
{
  ll p1= p * mid;
  ll q1 = q * mid;

  ll good = p1 - x;
  ll bad = q1 - y - good;

  if(good >=0 && bad >= 0)
    {
        ans = min(ans, good + bad);
        return true;
    }
  return false;
}
int main()
{
    ios::sync_with_stdio(0);
    int t;
    cin >> t;
    while(t--)
    {
        cin >> x >> y >> p >> q;
        ll l = 0, r = 1e18;
         ans = INF + 1;

        while(r - l > 1)
        {
            ll mid = (l + r) / 2;
            if(is(mid))
             r = mid;
            else
             l = mid;
        }
        bool cur = is(r - 1);

    if(ans == INF + 1)
        cout << -1;
    else
        cout << ans;
        cout << endl;
    }

    return 0;
}


#include <bits/stdc++.h>

using namespace std;

#define pb push_back
#define mp make_pair
#define ff first
#define ss second

typedef long long int ll;
typedef vector< pair<int, int> > vii;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<long long int> vll;
typedef pair<int, int> pii;

const ll INF = 1e18;
const int inf = 1e9;
const int MOD = 1e9 + 7;
const int nax = 1000000 + 10;

ll x, y, p, q;
ll ans;

bool is(int mid)
{
  ll p1= p * mid;
  ll q1 = q * mid;

  ll good = p1 - x;
  ll bad = q1 - y - good;

  if(good >=0 && bad >= 0)
    {
        ans = min(ans, good + bad);
        return true;
    }
  return false;
}
int main()
{
    ios::sync_with_stdio(0);
    int t;
    cin >> t;
    while(t--)
    {
        cin >> x >> y >> p >> q;
        ll l = 0, r = 1e10;
         ans = INF + 1;

        while(r - l > 1)
        {
            ll mid = (l + r) / 2;
            if(is(mid))
             r = mid;
            else
             l = mid;
        }
        bool cur = is(r - 1);

    if(ans == INF + 1)
        cout << -1;
    else
        cout << ans;
        cout << endl;
    }

    return 0;
}


#include <bits/stdc++.h>

using namespace std;

#define pb push_back
#define mp make_pair
#define ff first
#define ss second

typedef long long int ll;
typedef vector< pair<int, int> > vii;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<long long int> vll;
typedef pair<int, int> pii;

const ll INF = 1e18;
const int inf = 1e9;
const int MOD = 1e9 + 7;
const int nax = 1000000 + 10;

ll p, q, x, y;
bool is(ll nt)
{
    ll z = p * y + p * nt - q * x;
    z /= q;
    if(z >= 0 && z <= nt)
        return true;
    return false;
}
int main()
{
    ios::sync_with_stdio(0);

    int t; cin >> t;
    while(t--)
    {
        cin >> x >> y >> p >> q;
        ll l = 0;
        ll r = 1e15;
        ll ans = -1;

        while(r - l > 1)
        {
            ll mid = (l + r) / 2;
            if(is(mid) == true)
            {
                ans = mid;
                r = mid;
            }
            else
                l = mid;
        }
        ll mainans;
        if(ans == -1)
        {
            cout << -1 << endl;
            continue;
        }
        if(ans > 0 && is(ans - 1))
            mainans = ans - 1;
        else
            mainans = ans;
    ll temp = y + mainans;
    ll xnot;
    if(temp % q != 0)
        xnot = temp / q + 1;
    else
        xnot = temp / q;
    ll diff = q * xnot - temp;

    cout << mainans + diff << endl;

    }

    return 0;
}


#include <bits/stdc++.h>

using namespace std;

#define pb push_back
#define mp make_pair
#define ff first
#define ss second

typedef long long int ll;
typedef vector< pair<int, int> > vii;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<long long int> vll;
typedef pair<int, int> pii;

const ll INF = 1e18;
const int inf = 1e9;
const int MOD = 1e9 + 7;
const int nax = 1000000 + 10;

ll p, q, x, y;
bool is(ll nt)
{
    ll z = p * y + p * nt - q * x;
    z /= q;
    if(z >= 0 && z <= nt)
        return true;
    return false;
}
int main()
{
    ios::sync_with_stdio(0);

    int t; cin >> t;
    while(t--)
    {
        cin >> x >> y >> p >> q;
        ll l = 0;
        ll r = 1e14;
        ll ans = -1;

        while(r - l > 1)
        {
            ll mid = (l + r) / 2;
            if(is(mid) == true)
            {
                ans = mid;
                r = mid;
            }
            else
                l = mid;
        }
        ll mainans;
        if(ans == -1)
        {
            cout << -1 << endl;
            continue;
        }
        if(ans > 0 && is(ans - 1))
            mainans = ans - 1;
        else
            mainans = ans;
    ll temp = y + mainans;
    ll xnot;
    if(temp % q != 0)
        xnot = temp / q + 1;
    else
        xnot = temp / q;
    ll diff = q * xnot - temp;

    cout << mainans + diff << endl;

    }

    return 0;
}