
module S = Set.Make(struct
  type t = int * int
  let compare (p, b) (q, d) = q - p
end)

let parse s =
  let arr = Array.init (String.length s) (fun i -> s.[i]) in
  Array.fold_left (fun (p, b) c ->
    if c = '(' then (p+1, b) else (p-1, min b (p-1))) (0, 0) arr

let solve () =
  Scanf.scanf "%d" @@ fun n ->
  let s = List.init n (fun _ -> Scanf.scanf " %s" parse) in

  let ls = s |> List.filter (fun (p, b) -> p >= 0) |> Array.of_list in
  let rs = s |> List.filter (fun (p, b) -> p < 0) |> Array.of_list in

  Array.sort (fun (_, x) (_, y) -> y-x) ls;
  Array.sort (fun (p, b) (q, c) -> (c-q) - (b-p)) rs;

  let pm, bm =
    Array.fold_left (fun (pm, bm) (p, b) -> (pm + p, min bm (pm + b))) (0, 0) ls in

  if bm < 0 then "No" else

  let pf, bf =
    Array.fold_left (fun (pf, bf) (p, b) -> (pf + p, min bf (pf + b))) (pm, bm) rs in

  if pf = 0 && bf = 0 then "Yes" else "No"

let () = solve () |> print_endline