#include <bits/stdc++.h>
using namespace std;
#define nmax 1000007
#define ll long long
const long long mod = 1e9 + 7;
long long tcs(long long a)
{
long long tong = 0;
while(a>0)
{
tong+=a%10;
a/=10;
}
return tong;
}
signed main()
{
cin.tie(0) -> sync_with_stdio(0);
long long n;
cin>>n;
long long a = n/100, b = n%100;
tcs(a) == tcs(b) ? cout<<"YES" : cout<<"NO";
}