$n=<>;chop,$a{$_}++for<>;@a=reverse sort values%a;print$n>2*$a[0]-2?YES:NO,$/