N=gets.to_i counts={} N.times{ w = gets.chomp counts[w] ||= 0 counts[w] += 1 if(counts[w]>(N+1)/2) puts "NO" exit end } puts "YES"