#!/usr/bin/ruby                                                                                                                               
# -*- coding: utf-8 -*-                                                                                                                       


ratch = false
pos = 0
(gets.to_i).times {
  par, n = gets.split

  if par == "("
    pos += n.to_i
  else
    pos -= n.to_i
  end
  if pos < 0
    ratch = true
  end
}

if ratch || pos != 0
  puts "NO"
else
  puts "YES"
end