#include <bits/stdc++.h>
using namespace std;
int main() {
  long long a, c, b, d, n, m, num = 0;
  string str;
  set<char> st;
  cin >> n;
  cin >> str;
  sort(str.begin(), str.end());
  for (int i = 0; i < str.size() - 1; i++) {
    if (str[i] == str[i + 1])
      num += 2, i++;
    else
      num = 0;
    if (num >= 2) {
      cout << "YES" << endl;
      return 0;
    }
    st.insert(str[i]);
  }
  if (str.size() == 1)
    cout << "YES" << endl;
  else
    cout << "NO" << endl;
}
