import java.util.*;
import java.lang.*;
import java.io.*;


public class Main {
    public static void main(String[] args) throws java.lang.Exception {
        BufferedReader br = new BufferedReader(new InputStreamReader((System.in)));
        char[] s = br.readLine().toCharArray();
        int a = 0;
        int b = 0;
        for (int i = 0; i < s.length; i++) {
            a += s[i] == 'A' ? 1 : 0;
            b += s[i] == 'B' ? 1 : 0;
        }
        System.out.println((a == 2 || b == 2) ? "Yes" : "No");
    }
} import java.util.*; util.* java import java.lang.*; lang.* java import java.io.*; io.* java public class Main {
    public static void main(String[] args) throws java.lang.Exception {
        BufferedReader br = new BufferedReader(new InputStreamReader((System.in)));
        char[] s = br.readLine().toCharArray();
        int a = 0;
        int b = 0;
        for (int i = 0; i < s.length; i++) {
            a += s[i] == 'A' ? 1 : 0;
            b += s[i] == 'B' ? 1 : 0;
        }
        System.out.println((a == 2 || b == 2) ? "Yes" : "No");
    }
} Main public static void main(String[] args) throws java.lang.Exception {
        BufferedReader br = new BufferedReader(new InputStreamReader((System.in)));
        char[] s = br.readLine().toCharArray();
        int a = 0;
        int b = 0;
        for (int i = 0; i < s.length; i++) {
            a += s[i] == 'A' ? 1 : 0;
            b += s[i] == 'B' ? 1 : 0;
        }
        System.out.println((a == 2 || b == 2) ? "Yes" : "No");
    } main {
        BufferedReader br = new BufferedReader(new InputStreamReader((System.in)));
        char[] s = br.readLine().toCharArray();
        int a = 0;
        int b = 0;
        for (int i = 0; i < s.length; i++) {
            a += s[i] == 'A' ? 1 : 0;
            b += s[i] == 'B' ? 1 : 0;
        }
        System.out.println((a == 2 || b == 2) ? "Yes" : "No");
    } BufferedReader br = new BufferedReader(new InputStreamReader((System.in))); br new BufferedReader(new InputStreamReader((System.in))) char[] s = br.readLine().toCharArray(); s br.readLine().toCharArray() br.readLine().toCharArray br.readLine() br.readLine br int a = 0; a 0 int b = 0; b 0 for (int i = 0; i < s.length; i++) {
            a += s[i] == 'A' ? 1 : 0;
            b += s[i] == 'B' ? 1 : 0;
        } int i = 0; int i = 0; i 0 i < s.length i s.length s s.length i++ i++ i {
            a += s[i] == 'A' ? 1 : 0;
            b += s[i] == 'B' ? 1 : 0;
        } {
            a += s[i] == 'A' ? 1 : 0;
            b += s[i] == 'B' ? 1 : 0;
        } a += s[i] == 'A' ? 1 : 0 a s[i] == 'A' ? 1 : 0 s[i] == 'A' s[i] s i 'A' 1 0 b += s[i] == 'B' ? 1 : 0 b s[i] == 'B' ? 1 : 0 s[i] == 'B' s[i] s i 'B' 1 0 System.out.println((a == 2 || b == 2) ? "Yes" : "No") System.out.println System.out System System.out (a == 2 || b == 2) ? "Yes" : "No" (a == 2 || b == 2) a == 2 a 2 b == 2 b 2 "Yes" "No" String[] args args public class Main {
    public static void main(String[] args) throws java.lang.Exception {
        BufferedReader br = new BufferedReader(new InputStreamReader((System.in)));
        char[] s = br.readLine().toCharArray();
        int a = 0;
        int b = 0;
        for (int i = 0; i < s.length; i++) {
            a += s[i] == 'A' ? 1 : 0;
            b += s[i] == 'B' ? 1 : 0;
        }
        System.out.println((a == 2 || b == 2) ? "Yes" : "No");
    }
} public class Main {
    public static void main(String[] args) throws java.lang.Exception {
        BufferedReader br = new BufferedReader(new InputStreamReader((System.in)));
        char[] s = br.readLine().toCharArray();
        int a = 0;
        int b = 0;
        for (int i = 0; i < s.length; i++) {
            a += s[i] == 'A' ? 1 : 0;
            b += s[i] == 'B' ? 1 : 0;
        }
        System.out.println((a == 2 || b == 2) ? "Yes" : "No");
    }
} Main
import java.util.*;
import java.lang.*;
import java.io.*;


public class Main {
    public static void main(String[] args) throws java.lang.Exception {
        BufferedReader br = new BufferedReader(new InputStreamReader((System.in)));
        char[] s = br.readLine().toCharArray();
        int a = 0;
        int b = 0;
        for (int i = 0; i < s.length; i++) {
            a += s[i] == 'A' ? 1 : 0;
            b += s[i] == 'B' ? 1 : 0;
        }
        System.out.println((a == 2 || b == 2) ? "Yes" : "No");
    }
}