#include <bits/stdc++.h>
using namespace std;
int main() {
  stack<char> stk;
  char c;
  bool state = true;
  int i = 0;
  while (cin.good()) {
    cin >> noskipws >> c;
    if (c == EOF || c == '\n') break;
    if (stk.size() == 0) {
      stk.push(c);
      state = false;
    } else {
      if (stk.size() > 0 && stk.top() == c) {
        while (stk.size() > 0 && stk.top() == c) {
          stk.pop();
        }
        if (stk.size() == 0) {
          state = true;
        } else {
          state = false;
        }
      } else {
        stk.push(c);
        state = false;
      }
    }
  }
  cout << (state == true ? "Yes" : "No") << endl;
  return 0;
}
