#include <bits/stdc++.h>
using namespace std;
vector<char> q;
string s;
int main() {
  string n;
  cin >> n;
  int s = n.size();
  int one = 0, two = 0;
  q.push_back(n[0]);
  if (n[0] == '+')
    one++;
  else
    two++;
  for (int i = 1; i < s; i++) {
    if (n[i] == '+') {
      if (one)
        one--;
      else
        one++;
    } else {
      if (two)
        two--;
      else
        two++;
    }
    char x = n[i];
    char y = q.back();
    if (y == x)
      q.pop_back();
    else
      q.push_back(x);
  }
  if (q.empty() && one == two) {
    cout << "Yes";
  } else
    cout << "No";
  return 0;
}
