#include <bits/stdc++.h>
using namespace std;
int main() {
  string output = "";
  cin >> output;
  int loc = output.size() - 1;
  stack<char> container2;
  while (loc >= 0) {
    char v1 = output[loc];
    if (container2.size() == 0) {
      container2.push(v1);
    } else {
      char v2 = container2.top();
      if (v1 == v2) {
        container2.pop();
      } else {
        container2.push(v1);
      }
    }
    loc--;
  }
  if (container2.empty()) {
    cout << "YES";
  } else {
    cout << "NO";
  }
}
