#include <bits/stdc++.h>
int main() {
  char c, a[100004];
  int l, x = 0;
  while ((c = getchar()) != '\n') {
    if (x != 0) {
      if (a[x - 1] == c)
        x--;
      else
        a[x++] = c;
    } else
      a[x++] = c;
  }
  if (x == 0)
    printf("YES\n");
  else
    printf("NO\n");
  return 0;
}
