import java.util.Scanner;
public class Sample {
    public static void main(String args[]) {
        Scanner sc = new Scanner(System.in);
        int n1 = sc.nextInt();
        String str = sc.next();
        int c = 0,i = 1;
        int check = 0;
        while(str.charAt(i) == str.charAt(i-1)) {
            check = str.charAt(i);
            i = i+1;
        }
        for(int j = i; j < str.length(); j++) {
            int d1 = str.charAt(j);
            if(d1 <= check) {
                c = 1;
                break;
            }
        }
        if(c == 1) {
            System.out.println("yes");
        }
        else {
            System.out.println("no");
        }
    }
}