#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[1000000] = {}; int main() { //文字列をint化してからぶち込んでソート int n; scanf("%d", &n); REP(i, n) { string hogee; cin >> hogee; hoge[1000 * (int)hogee[0] + (int)hogee[1]]++; } sort(hoge, hoge + 900000, 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!