import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String[] S = scanner.nextLine().split("");
        int countA = 0;
        int countB = 0;
        for(int x = 0; x<3; x++){
            if(S[x].equals("A")){
                countA++;
            }else{
                countB++;
            }
        }
    
        if(countA == 2 || countB==2){
            System.out.println("Yes");
        }else{
            System.out.print("No");
        }




    }

} import java.util.*; util.* java public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String[] S = scanner.nextLine().split("");
        int countA = 0;
        int countB = 0;
        for(int x = 0; x<3; x++){
            if(S[x].equals("A")){
                countA++;
            }else{
                countB++;
            }
        }
    
        if(countA == 2 || countB==2){
            System.out.println("Yes");
        }else{
            System.out.print("No");
        }




    }

} Main public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String[] S = scanner.nextLine().split("");
        int countA = 0;
        int countB = 0;
        for(int x = 0; x<3; x++){
            if(S[x].equals("A")){
                countA++;
            }else{
                countB++;
            }
        }
    
        if(countA == 2 || countB==2){
            System.out.println("Yes");
        }else{
            System.out.print("No");
        }




    } main {
        Scanner scanner = new Scanner(System.in);
        String[] S = scanner.nextLine().split("");
        int countA = 0;
        int countB = 0;
        for(int x = 0; x<3; x++){
            if(S[x].equals("A")){
                countA++;
            }else{
                countB++;
            }
        }
    
        if(countA == 2 || countB==2){
            System.out.println("Yes");
        }else{
            System.out.print("No");
        }




    } Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) String[] S = scanner.nextLine().split(""); S scanner.nextLine().split("") scanner.nextLine().split scanner.nextLine() scanner.nextLine scanner "" int countA = 0; countA 0 int countB = 0; countB 0 for(int x = 0; x<3; x++){
            if(S[x].equals("A")){
                countA++;
            }else{
                countB++;
            }
        } int x = 0; int x = 0; x 0 x<3 x 3 x++ x++ x {
            if(S[x].equals("A")){
                countA++;
            }else{
                countB++;
            }
        } {
            if(S[x].equals("A")){
                countA++;
            }else{
                countB++;
            }
        } if(S[x].equals("A")){
                countA++;
            }else{
                countB++;
            } S[x].equals("A") S[x].equals S[x] S x "A" {
                countA++;
            } countA++ countA {
                countB++;
            } countB++ countB if(countA == 2 || countB==2){
            System.out.println("Yes");
        }else{
            System.out.print("No");
        } countA == 2 || countB==2 countA == 2 countA 2 countB==2 countB 2 {
            System.out.println("Yes");
        } System.out.println("Yes") System.out.println System.out System System.out "Yes" {
            System.out.print("No");
        } System.out.print("No") System.out.print System.out System System.out "No" String[] args args public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String[] S = scanner.nextLine().split("");
        int countA = 0;
        int countB = 0;
        for(int x = 0; x<3; x++){
            if(S[x].equals("A")){
                countA++;
            }else{
                countB++;
            }
        }
    
        if(countA == 2 || countB==2){
            System.out.println("Yes");
        }else{
            System.out.print("No");
        }




    }

} public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String[] S = scanner.nextLine().split("");
        int countA = 0;
        int countB = 0;
        for(int x = 0; x<3; x++){
            if(S[x].equals("A")){
                countA++;
            }else{
                countB++;
            }
        }
    
        if(countA == 2 || countB==2){
            System.out.println("Yes");
        }else{
            System.out.print("No");
        }




    }

} Main
import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String[] S = scanner.nextLine().split("");
        int countA = 0;
        int countB = 0;
        for(int x = 0; x<3; x++){
            if(S[x].equals("A")){
                countA++;
            }else{
                countB++;
            }
        }
    
        if(countA == 2 || countB==2){
            System.out.println("Yes");
        }else{
            System.out.print("No");
        }




    }

}
