#include <bits/stdc++.h>
using namespace std;
string wire;
int prevC[100000 + 5];
int main() {
  int neg = 0, pos = 0;
  cin >> wire;
  for (int i = 0; i < (int)wire.size(); i++) {
    if (wire[i] == '-') {
      if (i && neg && wire[prevC[i - 1]] == '-') {
        neg--;
        prevC[i] = prevC[prevC[i - 1] - 1];
      } else {
        neg++;
        prevC[i] = i;
      }
    } else {
      if (i && pos && wire[prevC[i - 1]] == '+') {
        pos--;
        prevC[i] = prevC[prevC[i - 1] - 1];
      } else {
        pos++;
        prevC[i] = i;
      }
    }
  }
  printf(!pos && !neg ? "Yes\n" : "No\n");
  return 0;
}
