#include <bits/stdc++.h>
using namespace std;
int main() {
  string pat;
  cin >> pat;
  int n = pat.size();
  int currwire = 0;
  stack<int> wire;
  int i;
  for (i = 0; i < n; i++) {
    if (pat[i] == '-')
      currwire = -1;
    else
      currwire = 1;
    if (wire.empty()) {
      wire.push(currwire);
      continue;
    }
    if (wire.top() == currwire) {
      wire.pop();
      continue;
    } else {
      wire.push(currwire);
    }
  }
  if (wire.size())
    cout << "No" << endl;
  else
    cout << "Yes" << endl;
}
