Problem: Mad scientist Mike has just finished constructing a new device to search for extraterrestrial intelligence! He was in such a hurry to launch it for the first time that he plugged in the power wires without giving it a proper glance and started experimenting right away. After a while Mike observed that the wires ended up entangled and now have to be untangled again.

The device is powered by two wires "plus" and "minus". The wires run along the floor from the wall (on the left) to the device (on the right). Both the wall and the device have two contacts in them on the same level, into which the wires are plugged in some order. The wires are considered entangled if there are one or more places where one wire runs above the other one. For example, the picture below has four such places (top view):

<image>

Mike knows the sequence in which the wires run above each other. Mike also noticed that on the left side, the "plus" wire is always plugged into the top contact (as seen on the picture). He would like to untangle the wires without unplugging them and without moving the device. Determine if it is possible to do that. A wire can be freely moved and stretched on the floor, but cannot be cut.

To understand the problem better please read the notes to the test samples.

Input

The single line of the input contains a sequence of characters "+" and "-" of length n (1 ≤ n ≤ 100000). The i-th (1 ≤ i ≤ n) position of the sequence contains the character "+", if on the i-th step from the wall the "plus" wire runs above the "minus" wire, and the character "-" otherwise.

Output

Print either "Yes" (without the quotes) if the wires can be untangled or "No" (without the quotes) if the wires cannot be untangled.

Examples

Input

-++-


Output

Yes


Input

+-


Output

No


Input

++


Output

Yes


Input

-


Output

No

Note

The first testcase corresponds to the picture in the statement. To untangle the wires, one can first move the "plus" wire lower, thus eliminating the two crosses in the middle, and then draw it under the "minus" wire, eliminating also the remaining two crosses.

In the second testcase the "plus" wire makes one full revolution around the "minus" wire. Thus the wires cannot be untangled: 

<image>

In the third testcase the "plus" wire simply runs above the "minus" wire twice in sequence. The wires can be untangled by lifting "plus" and moving it higher: 

<image>

In the fourth testcase the "minus" wire runs above the "plus" wire once. The wires cannot be untangled without moving the device itself: 

<image>

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
const long double pi = 3.1415926535897932384626433832795;
using namespace std;
unsigned long long int leftRotate(unsigned long long int n,
                                  unsigned long long int d) {
  return (n << d) | (n >> (16 - d));
}
unsigned long long int rightRotate(unsigned long long int n,
                                   unsigned long long int d) {
  return (n >> d) | (n << (16 - d));
}
int log2(int x) {
  int res = 0;
  while (x >>= 1) res++;
  return res;
}
long long int comb(long long int n, long long int r) {
  if (r == 0 || r == n) return 1;
  return comb(n - 1, r) + comb(n - 1, r - 1);
}
bool isPowerOfTwo(int n) {
  if (n == 0) return false;
  return (ceil(log2(n)) == floor(log2(n)));
}
long long int inverse(long long int a, long long int m) {
  return 1 < a ? m - inverse(m % a, a) * (m / a) : 1;
}
long long int issorted(long long int arr[], long long int n) {
  if (n == 1 || n == 0) return 1;
  if (arr[n - 1] < arr[n - 2]) return 0;
  return issorted(arr, n - 1);
}
int computeXOR(int n) {
  if (n % 4 == 0) return n;
  if (n % 4 == 1) return 1;
  if (n % 4 == 2)
    return n + 1;
  else
    return 0;
}
long long int count(string s) {
  long long int ans = 1, i, j;
  for (i = 1; i < s.length(); i++) {
    for (j = 0; j < i; j++) {
      if (s[i] == s[j]) break;
    }
    if (i == j) ans++;
  }
  return ans;
}
bool isPerfectSquare(long double x) {
  long double sr = sqrt(x);
  return ((sr - floor(sr)) == 0);
}
long long int countarray(long long int a[], long long int n) {
  unordered_set<long long int> s;
  for (long long int i = 0; i < n; i++) s.insert(a[i]);
  return s.size();
}
bool check(int N) {
  long long int i;
  if (N & (1 << i))
    return true;
  else
    return false;
}
bool isvowel(char ch) {
  string s = "aeiouAEIOU";
  for (char c : s) {
    if (c == ch) {
      return true;
    }
  }
  return false;
}
bool isPrime(long long int n) {
  if (n <= 1) return false;
  if (n <= 3) return true;
  if (n % 2 == 0 || n % 3 == 0) return false;
  for (long long int i = 5; i * i <= n; i = i + 6)
    if (n % i == 0 || n % (i + 2) == 0) return false;
  return true;
}
struct interval {
  int start, end;
};
bool compare(interval x, interval y) { return (x.start < y.start); }
bool isSubstring(string s1, string s2) {
  int M = s1.length();
  int N = s2.length();
  for (int i = 0; i <= N - M; i++) {
    int j;
    for (j = 0; j < M; j++)
      if (s2[i + j] != s1[j]) break;
    if (j == M) return true;
  }
  return false;
}
int seive(int n) {
  bool isprime[n + 1];
  for (int i = 2; i <= n; i++) isprime[i] = true;
  isprime[0] = false;
  isprime[1] = false;
  for (int i = 2; i <= sqrt(n); i++) {
    if (isprime[i] == true) {
      for (int j = i * i; j <= n; j += i) {
        isprime[j] = false;
      }
    }
  }
  int count = 0;
  for (int i = 0; i <= n; i++) {
    if (isprime[i] == true) count++;
  }
  return count;
}
void multiply(int a[2][2], int m[2][2]) {
  int him[2][2];
  for (int i = 0; i < 2; i++) {
    for (int j = 0; j < 2; j++) {
      him[i][j] = 0;
      for (int k = 0; k < 2; k++) {
        him[i][j] += (a[i][k] * m[k][j]);
      }
    }
  }
  for (int i = 0; i < 2; i++) {
    for (int j = 0; j < 2; j++) {
      a[i][j] = him[i][j];
    }
  }
}
void power(int a[2][2], int n) {
  if (n == 0 || n == 1) return;
  power(a, n / 2);
  multiply(a, a);
  if (n % 2 != 0) {
    int m[2][2] = {{1, 1}, {1, 0}};
    multiply(a, m);
  }
}
int fib(int n) {
  int a[2][2] = {{1, 1}, {1, 0}};
  if (n == 0) return 0;
  power(a, n - 1);
  return a[0][0];
}
int factmod(int n, int p) {
  int res = 1;
  while (n > 1) {
    res = (res * ((n / p) % 2 ? p - 1 : 1)) % p;
    for (int i = 2; i <= (n % p); i++) res = (res * i) % p;
    n /= p;
  }
  return res % p;
}
long long int modularexponentiation(long long int a, long long int n) {
  long long int res = 1;
  while (n > 0) {
    if (n & 1) res = ((res % 1000000007) * (a % 1000000007)) % 1000000007;
    n /= 2;
    a = ((a % 1000000007) * (a % 1000000007)) % 1000000007;
  }
  return res;
}
long long int largest_power(long long int N) {
  N = N | (N >> 1);
  N = N | (N >> 2);
  N = N | (N >> 4);
  N = N | (N >> 8);
  N = N | (N >> 16);
  return (N + 1) >> 1;
}
bool alternate(long long int n) {
  long long int i;
  if ((n ^ (n >> 1)) == (pow(2, i) - 1)) return true;
  return false;
}
long long int countDivisors(long long int n) {
  long long int cnt = 0;
  for (int i = 1; i <= sqrt(n); i++) {
    if (n % i == 0) {
      if (n / i == i)
        cnt++;
      else
        cnt = cnt + 2;
    }
  }
  return cnt;
}
int highestpowerof2(int n) { return (n & (~(n - 1))); }
void lowertoupper(char ch) {
  ch = ch & '_';
  cout << ch << " ";
}
void uppertolower(char ch) {
  ch = ch | ' ';
  cout << ch << " ";
}
long long int primecounter(long long int l, long long int r) {
  long long int fact = 1, count = 0;
  for (long long int i = l; i <= r; i++) {
    if (((fact - i) % ((1LL << i) - 1)) == 0) count++;
    fact *= ((1LL << i) - 1);
  }
  return count;
}
long long int counteprime(long long int l, long long int r) {
  long long int count = 0, i, j;
  for (i = l; i <= r; i++) {
    for (j = 2; j <= (i / j); j++) {
      if (!(i % j)) break;
    }
    if (j > (i / j)) count++;
  }
  return count;
}
void pairsort(int a[], char b[], int n) {
  pair<int, char> pairt[n];
  for (int i = 0; i < n; i++) {
    pairt[i].first = a[i];
    pairt[i].second = b[i];
  }
  sort(pairt, pairt + n);
  for (int i = 0; i < n; i++) {
    a[i] = pairt[i].first;
    b[i] = pairt[i].second;
  }
}
long long int fibo(long long int n) {
  long double him = (1 + sqrt(5)) / 2;
  return round(pow(him, n) / sqrt(5));
}
long long int binToDec(string c) {
  long long int count = 0;
  for (long long int i = 0; i < c.length(); i++) {
    if (c[i] == '1') {
      long long int val = 1;
      for (long long int j = 0; j < i; j++) {
        val *= 2;
      }
      count += val;
    }
  }
  return count;
}
void rev(int a[], int n) {
  for (long long int i = 0, j = n - 1; i < j; i++, j--) {
    swap(a[i], a[j]);
  }
  for (int i = 0; i < n; i++) cout << a[i] << " ";
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
  string s;
  cin >> s;
  stack<char> ss;
  ss.push(s[0]);
  for (int i = 1; i <= s.length() - 1; i++) {
    if (!ss.empty() && ss.top() == s[i])
      ss.pop();
    else
      ss.push(s[i]);
  }
  if (ss.empty())
    cout << "Yes\n";
  else
    cout << "No\n";
  return 0;
}