#include <bits/stdc++.h>
using namespace std;
int n, a, b, i, j, x, y;
string st;
stack<char> s1;
int main() {
  cin >> st;
  n = st.size();
  for (i = 0; i < n; i++) {
    if (s1.size() == 0)
      s1.push(st[i]);
    else if (st[i] == s1.top())
      s1.pop();
    else
      s1.push(st[i]);
  }
  if (s1.size() == 0)
    cout << "YES";
  else
    cout << "NO";
}
