#include <bits/stdc++.h>
using namespace std;
int main() {
  string aa;
  cin >> aa;
  list<int> a;
  int plus = 0, minus = 0;
  for (char i : aa) {
    if (i == '+') {
      a.push_back(0);
      plus++;
    } else {
      a.push_back(1);
      minus++;
    }
  }
  if ((minus % 2 == 1) || (plus % 2 == 1))
    cout << "NO";
  else {
    list<int>::iterator i = a.begin();
    while (i != a.end()) {
      if (*i == *(++i)) {
        a.erase(i--);
        a.erase(i++);
        if (i != a.begin()) i--;
      }
    }
    if (a.empty())
      cout << "YES";
    else
      cout << "NO";
  }
  return (0);
}
