#include<iostream>\可用万能头#include<bits/stdc++.h>
#include<stack>
#include<string>
using namespace std;
int main()
{
ios::sync_with_stdio(false);
cin.tie(nullptr);
stack<char>a;
string b;
cin>>b;
for(int i=0;i<b.length();i++)
{
if(b[i]'(')
{
a.push('(');
}
else if(b[i]')')
{
if(a.empty())
{
cout<<"NO"<<endl;
return 0;
}
a.pop();
}
}
if(a.empty())
{
cout<<"YES"<<endl;
}
else
{
cout<<"NO"<<endl;
}
return 0;
}