#include <bits/stdc++.h>
using namespace std;
int main() {
  string a;
  cin >> a;
  stack<char> st;
  for (long long i = 0; i < a.length(); i++) {
    char t = 'z';
    if (!st.empty()) t = st.top();
    st.push(a[i]);
    while (!st.empty() and t == a[i]) {
      st.pop();
      if (!st.empty()) t = st.top();
    }
  }
  if (st.empty())
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
}
