alist = list(input()) tt = 0 for n in alist: if n == '(': tt += 1 elif n == ')': tt -= 1 if tt < 0: break if tt == 0: print('YES') else: print('NO')