#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  list<char> li;
  for (int i = 0; i < s.length(); i++) li.push_back(s[i]);
  list<char>::iterator head, tail;
  head = li.begin();
  tail = ++li.begin();
  while (!li.empty() && tail != li.end()) {
    if (*head == *tail) {
      tail = li.erase(tail);
      head = li.erase(head);
      if (head == li.begin()) {
        head = tail++;
      } else {
        head--;
      }
    } else {
      head = tail++;
    }
  }
  if (li.empty())
    cout << "YES" << endl;
  else
    cout << "NO" << endl;
  return 0;
}
