#include <bits/stdc++.h>
using namespace std;
int main() {
  stack<char> S;
  string s;
  cin >> s;
  int len = s.length();
  for (int i = 0; i < len; ++i) {
    if (!S.empty()) {
      if (S.top() == s[i])
        S.pop();
      else
        S.push(s[i]);
    } else
      S.push(s[i]);
  }
  if (S.empty())
    cout << "YES\n";
  else
    cout << "NO\n";
  return 0;
}
