#include <bits/stdc++.h>
using namespace std;
int compare(const void* a, const void* b) { return (*(int*)a - *(int*)b); }
int gcd(int a, int b) { return (b == 0) ? a : gcd(b, a % b); }
int tc;
int main() {
  vector<char> a;
  char s[1000000];
  scanf("%s", s);
  int i, n;
  n = strlen(s);
  a.push_back(s[0]);
  for (i = 1; i < n; i++) {
    if (a.size() > 0) {
      if (s[i] == a[a.size() - 1]) {
        a.pop_back();
      } else {
        a.push_back(s[i]);
      }
    } else {
      a.push_back(s[i]);
    }
  }
  if (a.size() == 0)
    printf("Yes\n");
  else
    printf("No\n");
  return 0;
}
