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