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