#define _CRT_SECURE_NO_WARNINGS #define _USE_MATH_DEFINES #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; #define REP(a,b) for(long long a = 0;a < b;++a) int hoge[100000000] = {}; int main() { //文字列をint化してからぶち込んでソート int n; scanf("%d", &n); REP(i, n) { string hogee; cin >> hogee; int queque = 0; for (int q = 1;q < hogee.length() + 1;++q) { queque += pow(10,q)*((int)hogee[q - 1]); } hoge[queque]++; } sort(hoge, hoge + 90000000, greater()); int ans = n / 2; if (n % 2 == 1) ans++; if (ans >= hoge[0]) { cout << "YES" << endl; } else { cout << "NO" << endl; } } //thank you for reading my code!