N = int(input()) S = input() st = [] for c in S: if len(st) == 0: st.append(c) elif c == '(': if st[-1] == ')': st.pop() else: st.append(c) elif c == ')': if st[-1] == '(': st.pop() else: st.append(c) if len(st) == 0: print('Yes') else: print('No')