#include <bits/stdc++.h>
using namespace std;
vector<char> v;
int main() {
  string s;
  cin >> s;
  v.push_back(s[0]);
  for (int i = 1; i < s.size(); i++) {
    if (s[i] == v.back()) {
      v.pop_back();
    } else {
      v.push_back(s[i]);
    }
  }
  if (v.size() == 0) {
    cout << "YES";
  } else {
    cout << "NO";
  }
}
