#include<bits/stdc++.h>
#define endl "\n"
using namespace std;
char s[300005];
bool mark[30];
struct tnode{
bool f[30];
};
stack<tnode> ls;
int main(){
ios::sync_with_stdio(0);
cin.tie(0);cout.tie(0);
string ps;getline(cin,ps);
int n=ps.size();
for(int i=0;i<n;i++){
s[i+1]=ps[i];
}
int l=0,r=0;
tnode nt;
for(int j=0;j<24;j++){
nt.f[j]=0;
}
ls.push(nt);
for(int i=1;i<=n;i++){
if(s[i]=='('){
tnode nt;
for(int j=0;j<24;j++){
nt.f[j]=0;
}
ls.push(nt);
}
else if(s[i]==')'){
for(int j=0;j<24;j++){
if(ls.top().f[j]){
mark[j]=0;
}
}
ls.pop();
}
else{
if(!mark[s[i]-'a']){
ls.top().f[s[i]-'a']=1;
mark[s[i]-'a']=1;
}
else{
cout<<"No";
return 0;
}
}
}
cout<<"Yes";
return 0;
}