#include <bits/stdc++.h>
using namespace std;
char s[1000001];
char a[1000001];
int m;
int main() {
  gets(s);
  m = 0;
  int n = strlen(s);
  for (int i = 0; i < n; ++i) {
    if (m && a[m - 1] == s[i])
      --m;
    else
      a[m++] = s[i];
  }
  cout << (!m ? "YES\n" : "NO\n");
}
