#include <iostream>
#include <stack>
#include <string>

using namespace std;

string canUntangleWires(const string& sequence) {
    stack<char> s;

    for (char ch : sequence) {
        // If the stack is not empty and the top character is the same as the current one,
        // pop the top character (i.e., they cancel each other out).
        if (!s.empty() && s.top() == ch) {
            s.pop();
        } else {
            // Otherwise, push the current character onto the stack.
            s.push(ch);
        }
    }

    // If the stack is empty, all crossings are resolved
    return s.empty() ? "Yes" : "No";
}

int main() {
    string sequence;
    cin >> sequence;
    cout << canUntangleWires(sequence) << endl;
    return 0;
}