import std.stdio, std.conv, std.string, std.range, std.math, std.bigint, std.algorithm, core.bitop; void main() { auto N = readln.strip.to!int; auto A = stdin.byLineCopy.array; (A.sort().group.map!"a[1]".reduce!max <= (N + 1) / 2 ? "YES" : "NO").writeln; }