import java.util.*;
public class Main {
	public static void main(String[] args) {
    	Scanner sc = new Scanner(System.in);
        String S = sc.nextLine();
        sc.close();
        if (S.length() != 3) {
			PrintNo();
			return;
        }
        int anum = 0;
        int bnum = 0;
        for (int i = 0; i < 3; i++) {
	        if (S.substring(i,i+1).equals("A") == false &&
	            S.substring(i,i+1).equals("B") == false ) {
                PrintNo();
                return;
            }
            if (S.substring(i,i+1).equals("A")) {
            	anum++;
                continue;
            }
			bnum++;
        }
        if (anum == 0 || bnum == 0) {
            PrintNo();
            return;
        }
        PrintYes();
        return;
    }
    private static void PrintYes() {
        System.out.println("Yes");
	}
    private static void PrintNo() {
        System.out.println("No");
	}
} import java.util.*; util.* java public class Main {
	public static void main(String[] args) {
    	Scanner sc = new Scanner(System.in);
        String S = sc.nextLine();
        sc.close();
        if (S.length() != 3) {
			PrintNo();
			return;
        }
        int anum = 0;
        int bnum = 0;
        for (int i = 0; i < 3; i++) {
	        if (S.substring(i,i+1).equals("A") == false &&
	            S.substring(i,i+1).equals("B") == false ) {
                PrintNo();
                return;
            }
            if (S.substring(i,i+1).equals("A")) {
            	anum++;
                continue;
            }
			bnum++;
        }
        if (anum == 0 || bnum == 0) {
            PrintNo();
            return;
        }
        PrintYes();
        return;
    }
    private static void PrintYes() {
        System.out.println("Yes");
	}
    private static void PrintNo() {
        System.out.println("No");
	}
} Main public static void main(String[] args) {
    	Scanner sc = new Scanner(System.in);
        String S = sc.nextLine();
        sc.close();
        if (S.length() != 3) {
			PrintNo();
			return;
        }
        int anum = 0;
        int bnum = 0;
        for (int i = 0; i < 3; i++) {
	        if (S.substring(i,i+1).equals("A") == false &&
	            S.substring(i,i+1).equals("B") == false ) {
                PrintNo();
                return;
            }
            if (S.substring(i,i+1).equals("A")) {
            	anum++;
                continue;
            }
			bnum++;
        }
        if (anum == 0 || bnum == 0) {
            PrintNo();
            return;
        }
        PrintYes();
        return;
    } main {
    	Scanner sc = new Scanner(System.in);
        String S = sc.nextLine();
        sc.close();
        if (S.length() != 3) {
			PrintNo();
			return;
        }
        int anum = 0;
        int bnum = 0;
        for (int i = 0; i < 3; i++) {
	        if (S.substring(i,i+1).equals("A") == false &&
	            S.substring(i,i+1).equals("B") == false ) {
                PrintNo();
                return;
            }
            if (S.substring(i,i+1).equals("A")) {
            	anum++;
                continue;
            }
			bnum++;
        }
        if (anum == 0 || bnum == 0) {
            PrintNo();
            return;
        }
        PrintYes();
        return;
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String S = sc.nextLine(); S sc.nextLine() sc.nextLine sc sc.close() sc.close sc if (S.length() != 3) {
			PrintNo();
			return;
        } S.length() != 3 S.length() S.length S 3 {
			PrintNo();
			return;
        } PrintNo() PrintNo return; int anum = 0; anum 0 int bnum = 0; bnum 0 for (int i = 0; i < 3; i++) {
	        if (S.substring(i,i+1).equals("A") == false &&
	            S.substring(i,i+1).equals("B") == false ) {
                PrintNo();
                return;
            }
            if (S.substring(i,i+1).equals("A")) {
            	anum++;
                continue;
            }
			bnum++;
        } int i = 0; int i = 0; i 0 i < 3 i 3 i++ i++ i {
	        if (S.substring(i,i+1).equals("A") == false &&
	            S.substring(i,i+1).equals("B") == false ) {
                PrintNo();
                return;
            }
            if (S.substring(i,i+1).equals("A")) {
            	anum++;
                continue;
            }
			bnum++;
        } {
	        if (S.substring(i,i+1).equals("A") == false &&
	            S.substring(i,i+1).equals("B") == false ) {
                PrintNo();
                return;
            }
            if (S.substring(i,i+1).equals("A")) {
            	anum++;
                continue;
            }
			bnum++;
        } if (S.substring(i,i+1).equals("A") == false &&
	            S.substring(i,i+1).equals("B") == false ) {
                PrintNo();
                return;
            } S.substring(i,i+1).equals("A") == false &&
	            S.substring(i,i+1).equals("B") == false S.substring(i,i+1).equals("A") == false S.substring(i,i+1).equals("A") S.substring(i,i+1).equals S.substring(i,i+1) S.substring S i i+1 i 1 "A" false S.substring(i,i+1).equals("B") == false S.substring(i,i+1).equals("B") S.substring(i,i+1).equals S.substring(i,i+1) S.substring S i i+1 i 1 "B" false {
                PrintNo();
                return;
            } PrintNo() PrintNo return; if (S.substring(i,i+1).equals("A")) {
            	anum++;
                continue;
            } S.substring(i,i+1).equals("A") S.substring(i,i+1).equals S.substring(i,i+1) S.substring S i i+1 i 1 "A" {
            	anum++;
                continue;
            } anum++ anum continue; bnum++ bnum if (anum == 0 || bnum == 0) {
            PrintNo();
            return;
        } anum == 0 || bnum == 0 anum == 0 anum 0 bnum == 0 bnum 0 {
            PrintNo();
            return;
        } PrintNo() PrintNo return; PrintYes() PrintYes return; String[] args args private static void PrintYes() {
        System.out.println("Yes");
	} PrintYes {
        System.out.println("Yes");
	} System.out.println("Yes") System.out.println System.out System System.out "Yes" private static void PrintNo() {
        System.out.println("No");
	} PrintNo {
        System.out.println("No");
	} System.out.println("No") System.out.println System.out System System.out "No" public class Main {
	public static void main(String[] args) {
    	Scanner sc = new Scanner(System.in);
        String S = sc.nextLine();
        sc.close();
        if (S.length() != 3) {
			PrintNo();
			return;
        }
        int anum = 0;
        int bnum = 0;
        for (int i = 0; i < 3; i++) {
	        if (S.substring(i,i+1).equals("A") == false &&
	            S.substring(i,i+1).equals("B") == false ) {
                PrintNo();
                return;
            }
            if (S.substring(i,i+1).equals("A")) {
            	anum++;
                continue;
            }
			bnum++;
        }
        if (anum == 0 || bnum == 0) {
            PrintNo();
            return;
        }
        PrintYes();
        return;
    }
    private static void PrintYes() {
        System.out.println("Yes");
	}
    private static void PrintNo() {
        System.out.println("No");
	}
} public class Main {
	public static void main(String[] args) {
    	Scanner sc = new Scanner(System.in);
        String S = sc.nextLine();
        sc.close();
        if (S.length() != 3) {
			PrintNo();
			return;
        }
        int anum = 0;
        int bnum = 0;
        for (int i = 0; i < 3; i++) {
	        if (S.substring(i,i+1).equals("A") == false &&
	            S.substring(i,i+1).equals("B") == false ) {
                PrintNo();
                return;
            }
            if (S.substring(i,i+1).equals("A")) {
            	anum++;
                continue;
            }
			bnum++;
        }
        if (anum == 0 || bnum == 0) {
            PrintNo();
            return;
        }
        PrintYes();
        return;
    }
    private static void PrintYes() {
        System.out.println("Yes");
	}
    private static void PrintNo() {
        System.out.println("No");
	}
} Main
import java.util.*;
public class Main {
	public static void main(String[] args) {
    	Scanner sc = new Scanner(System.in);
        String S = sc.nextLine();
        sc.close();
        if (S.length() != 3) {
			PrintNo();
			return;
        }
        int anum = 0;
        int bnum = 0;
        for (int i = 0; i < 3; i++) {
	        if (S.substring(i,i+1).equals("A") == false &&
	            S.substring(i,i+1).equals("B") == false ) {
                PrintNo();
                return;
            }
            if (S.substring(i,i+1).equals("A")) {
            	anum++;
                continue;
            }
			bnum++;
        }
        if (anum == 0 || bnum == 0) {
            PrintNo();
            return;
        }
        PrintYes();
        return;
    }
    private static void PrintYes() {
        System.out.println("Yes");
	}
    private static void PrintNo() {
        System.out.println("No");
	}
}