#include <iostream>
#include <stack>
#include <string>
using namespace std;
string s;
stack<char> Stack;
int main()
{
cin>>s;
for (int i=0;i<s.size();i++)
{
if (s[i]=='(')
Stack.push('(');
else if (s[i]==')')
{
if (Stack.top()=='(')
Stack.pop();
else
Stack.push(')');
}
}
if (Stack.empty())
printf("YES");
else
printf("NO");
}