import java.util.*;
class Main{
	public static void main(String[]args){
      Scanner in = new Scanner(System.in);
      String n = in.nextLine();int c =0, d=0;
      for(int i = 0 ; i < n.length() ; i++){
      	if(n.charAt(i)=='A')
          c++;
      }
      for(int i = 0 ; i < n.length() ; i++){
      	if(n.charAt(i)=='B')
          d++;
      }
      if(c==2)
        System.out.println("Yes");
      else if(d==2)
         System.out.println("Yes");
      else
         System.out.println("No");
    }
} import java.util.*; util.* java class Main{
	public static void main(String[]args){
      Scanner in = new Scanner(System.in);
      String n = in.nextLine();int c =0, d=0;
      for(int i = 0 ; i < n.length() ; i++){
      	if(n.charAt(i)=='A')
          c++;
      }
      for(int i = 0 ; i < n.length() ; i++){
      	if(n.charAt(i)=='B')
          d++;
      }
      if(c==2)
        System.out.println("Yes");
      else if(d==2)
         System.out.println("Yes");
      else
         System.out.println("No");
    }
} Main public static void main(String[]args){
      Scanner in = new Scanner(System.in);
      String n = in.nextLine();int c =0, d=0;
      for(int i = 0 ; i < n.length() ; i++){
      	if(n.charAt(i)=='A')
          c++;
      }
      for(int i = 0 ; i < n.length() ; i++){
      	if(n.charAt(i)=='B')
          d++;
      }
      if(c==2)
        System.out.println("Yes");
      else if(d==2)
         System.out.println("Yes");
      else
         System.out.println("No");
    } main {
      Scanner in = new Scanner(System.in);
      String n = in.nextLine();int c =0, d=0;
      for(int i = 0 ; i < n.length() ; i++){
      	if(n.charAt(i)=='A')
          c++;
      }
      for(int i = 0 ; i < n.length() ; i++){
      	if(n.charAt(i)=='B')
          d++;
      }
      if(c==2)
        System.out.println("Yes");
      else if(d==2)
         System.out.println("Yes");
      else
         System.out.println("No");
    } Scanner in = new Scanner(System.in); in new Scanner(System.in) String n = in.nextLine(); n in.nextLine() in.nextLine in int c =0 c 0 d=0; d 0 for(int i = 0 ; i < n.length() ; i++){
      	if(n.charAt(i)=='A')
          c++;
      } int i = 0 ; int i = 0 ; i 0 i < n.length() i n.length() n.length n i++ i++ i {
      	if(n.charAt(i)=='A')
          c++;
      } {
      	if(n.charAt(i)=='A')
          c++;
      } if(n.charAt(i)=='A')
          c++; n.charAt(i)=='A' n.charAt(i) n.charAt n i 'A' c++ c for(int i = 0 ; i < n.length() ; i++){
      	if(n.charAt(i)=='B')
          d++;
      } int i = 0 ; int i = 0 ; i 0 i < n.length() i n.length() n.length n i++ i++ i {
      	if(n.charAt(i)=='B')
          d++;
      } {
      	if(n.charAt(i)=='B')
          d++;
      } if(n.charAt(i)=='B')
          d++; n.charAt(i)=='B' n.charAt(i) n.charAt n i 'B' d++ d if(c==2)
        System.out.println("Yes");
      else if(d==2)
         System.out.println("Yes");
      else
         System.out.println("No"); c==2 c 2 System.out.println("Yes") System.out.println System.out System System.out "Yes" if(d==2)
         System.out.println("Yes");
      else
         System.out.println("No"); d==2 d 2 System.out.println("Yes") System.out.println System.out System System.out "Yes" System.out.println("No") System.out.println System.out System System.out "No" String[]args args
import java.util.*;
class Main{
	public static void main(String[]args){
      Scanner in = new Scanner(System.in);
      String n = in.nextLine();int c =0, d=0;
      for(int i = 0 ; i < n.length() ; i++){
      	if(n.charAt(i)=='A')
          c++;
      }
      for(int i = 0 ; i < n.length() ; i++){
      	if(n.charAt(i)=='B')
          d++;
      }
      if(c==2)
        System.out.println("Yes");
      else if(d==2)
         System.out.println("Yes");
      else
         System.out.println("No");
    }
}