#include <bits/stdc++.h>
using namespace std;
string n;
int cnt;
int main() {
cin >> n;
if (n.length()&1) {
cout << "NO";
return 0;
}
for (int i=0; i<n.length(); i++)
if (i<n.length()/2)
cnt += (n[i]-'0');
else
cnt -= (n[i]-'0');
cout << (cnt==0 ? "YES" : "NO");
return 0;
}
I2luY2x1ZGUgPGJpdHMvc3RkYysrLmg+CnVzaW5nIG5hbWVzcGFjZSBzdGQ7CnN0cmluZyBuOwppbnQgY250OwppbnQgbWFpbigpIHsKICAgIGNpbiA+PiBuOwogICAgaWYgKG4ubGVuZ3RoKCkmMSkgewogICAgICAgIGNvdXQgPDwgIk5PIjsKICAgICAgICByZXR1cm4gMDsKICAgIH0KICAgIGZvciAoaW50IGk9MDsgaTxuLmxlbmd0aCgpOyBpKyspCiAgICAgICAgaWYgKGk8bi5sZW5ndGgoKS8yKQogICAgICAgICAgICBjbnQgKz0gKG5baV0tJzAnKTsKICAgICAgICBlbHNlCiAgICAgICAgICAgIGNudCAtPSAobltpXS0nMCcpOwogICAgY291dCA8PCAoY250PT0wID8gIllFUyIgOiAiTk8iKTsgCglyZXR1cm4gMDsKfQ==