#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1e6 + 7;
const long long Mod = 152076289;
char seq[MAXN], s[MAXN];
int T = 1;
int main(void) {
  scanf("%s", seq);
  int L = strlen(seq);
  if (L % 2 == 1) {
    printf("No\n");
    return 0;
  }
  s[1] = seq[0];
  for (int i = 1; i < L; i++) {
    if (s[T] == seq[i] && T > 0) {
      T--;
      continue;
    } else {
      T++;
      s[T] = seq[i];
    }
  }
  if (T == 0)
    printf("Yes\n");
  else
    printf("No\n");
  return 0;
}
