#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  stack<char> a;
  string x;
  cin >> x;
  for (int i = 0; i < x.size(); i++) {
    if (a.empty()) {
      a.push(x[i]);
    } else {
      if (x[i] == a.top()) {
        a.pop();
      } else {
        a.push(x[i]);
      }
    }
  }
  if (a.empty()) {
    cout << "YES" << endl;
  } else {
    cout << "NO" << endl;
  }
  return 0;
}
