#include<iostream>
#include<algorithm>
#include<cstring>
using namespace std;
int stack[21];
char str[256];
int main()
{
int i,len,top=0;
cin>>str;
len=strlen(str);
for(i=0;i<len;i++)
{
if(str[i]=='(')
stack[++top]=str[i];
if(str[i]==')')
if(top!=0)
top--;
else
{
cout<<"NO";
break;
}
}
if(top!=0) cout<<"NO";
else cout<<"YES";
return 0;
}