#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; #define rep(i,j) REP((i), 0, (j)) #define REP(i,j,k) for(int i=(j);(i)<(k);++i) #define BW(a,x,b) ((a)<=(x)&&(x)<=(b)) #define ALL(v) (v).begin(), (v).end() #define LENGTHOF(x) (sizeof(x) / sizeof(*(x))) #define AFILL(a, b) fill((int*)a, (int*)(a + LENGTHOF(a)), b) #define SQ(x) ((x)*(x)) #define Mod(x, mod) (((x)+(mod)%(mod)) #define MP make_pair #define PB push_back #define Fi first #define Se second #define INF (1<<29) #define EPS 1e-10 #define MOD 1000000007 typedef pair pi; typedef pair pii; typedef vector vi; typedef queue qi; typedef long long ll; int main() { int N; mapm; cin >> N; rep(i, N){ string A; cin >> A; if(m.find(A) == m.end()) m[A] = 1; else m[A] = m[A] + 1; } for(auto &a: m){ if(N / 2 < a.second){ cout << "NO\n"; return 0; } } cout << "YES\n"; return 0; }