#include<bits/stdc++.h>
using namespace std;
int main()
{
string a;
cin>>a;
char b[100];
int top=0;
for(int i=0;i<a.length();i++)
{
if(a[i]=='(')
{
b[++top]=a[i];
}
else
{
if(a[i]==')')
{
if(b[top]=='(')
top--;
}
}
}
if(top==0)
{
cout<<"YES";
}
else
{
cout<<"NO";
}
return 0;
}