#include <bits/stdc++.h>
using namespace std;
char s[100001];
int a[100];
int main() {
  int T, n;
  scanf("%d", &n);
  scanf("%s", s);
  for (int i = 0; i < n; i++) {
    a[s[i] - 'a']++;
  }
  int judge = 0;
  int count = 0;
  for (int i = 0; i < 26; i++) {
    if (a[i] == 1) {
      judge++;
    } else if (a[i] > 1) {
      count++;
    }
  }
  if (judge == 1 && count == 0) {
    printf("YES\n");
    return 0;
  }
  if (count == 0) {
    printf("NO\n");
  } else {
    printf("YES\n");
  }
  return 0;
}
