#define _USE_MATH_DEFINES #include #define FOR(i,a,b) for(int i = (a); i < (b); ++i) #define REP(i,n) FOR(i,0,n) #define SZ(n) (int)(n).size() #define ALL(n) (n).begin(), (n).end() #define MOD 1000000007 using namespace std; typedef long long LL; typedef vector VI; int main() { int n; cin >> n; map a; REP(i, n) { string s; cin >> s; a[s]++; } int t; for (auto& i : a) { t = max(t, i.second); } if(t <= (n + 1) / 2)cout << "YES" << endl; else cout << "NO" << endl; return 0; }