import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.*;
public class Main {
public static Scanner sc = new Scanner(System.in);
public static BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
public static void main(String[] args) throws Exception {
String str = reader.readLine();
System.out.println(isOK(str) ? "YES" : "NO");
}
static boolean isOK(String str){
int len = str.length();
char[] chars = str.toCharArray();
for(int i=0;i<len;i++){
if(! (chars[i] == '(' || chars[i] == ')') ){
return false;
}
}
int leftKuo = 0;
for(int i=0;i<len;i++){
if(chars[i] == '('){
leftKuo++;
}
if(chars[i] == ')'){
if(leftKuo > 0){
leftKuo --;
}else {
return false;
}
}
}
if(leftKuo != 0){
return false;
}
return true;
}
}
/*
A1BC22DE1F
1221
*/