n = gets.to_i h = Hash.new{0} while line = gets do s = line.chomp h[s] += 1 end max = h.values.max puts (max <= (n + 1) / 2) ? "YES" : "NO"