#include <bits/stdc++.h>
using namespace std;
const int inv = 1000000000;
const int minv = -inv;
const int max_n = 100010;
int n;
char s[max_n + 5];
bool possible;
stack<int> st0, st1;
void process() {
  while (!st0.empty()) st0.pop();
  while (!st1.empty()) st1.pop();
  for (int i = 0; i < n; ++i) {
    if (s[i] == '-') {
      if (st0.empty() and st1.empty())
        st0.push(i);
      else if (st0.empty())
        st0.push(i);
      else if (st1.empty())
        st0.pop();
      else {
        if (st0.top() > st1.top())
          st0.pop();
        else
          st0.push(i);
      }
    } else {
      if (st0.empty() and st1.empty())
        st1.push(i);
      else if (st0.empty())
        st1.pop();
      else if (st1.empty())
        st1.push(i);
      else {
        if (st1.top() > st0.top())
          st1.pop();
        else
          st1.push(i);
      }
    }
  }
  if (st0.empty() and st1.empty()) possible = true;
}
int main() {
  scanf("%s", s);
  for (n = 0; s[n] != '\0'; ++n)
    ;
  possible = false;
  process();
  if (possible)
    printf("YES\n");
  else
    printf("NO\n");
  return 0;
}
