import java.util.Scanner;

public class Main{

    public static void main(String[] args){
        Scanner scan = new Scanner(System.in);

        // input
        char[] input = scan.next().toCharArray();

        // search
        char temp1 = input[0];
        char temp2 ='t';
        int count = 1;
        String answer = "Yes";
        for(int i = 1; i < input.length; i++){
            if(temp1 != input[i] && count == 1){
                temp2 = input[i];
                count++;
            } else if(count == 2 && temp1 != input[i] && temp2 != input[i]){
                answer = "No";
            }
        }
        if(count == 1){
            answer = "No";
        }

        // answer
        System.out.println(answer);

    }
} import java.util.Scanner; Scanner java.util public class Main{

    public static void main(String[] args){
        Scanner scan = new Scanner(System.in);

        // input
        char[] input = scan.next().toCharArray();

        // search
        char temp1 = input[0];
        char temp2 ='t';
        int count = 1;
        String answer = "Yes";
        for(int i = 1; i < input.length; i++){
            if(temp1 != input[i] && count == 1){
                temp2 = input[i];
                count++;
            } else if(count == 2 && temp1 != input[i] && temp2 != input[i]){
                answer = "No";
            }
        }
        if(count == 1){
            answer = "No";
        }

        // answer
        System.out.println(answer);

    }
} Main public static void main(String[] args){
        Scanner scan = new Scanner(System.in);

        // input
        char[] input = scan.next().toCharArray();

        // search
        char temp1 = input[0];
        char temp2 ='t';
        int count = 1;
        String answer = "Yes";
        for(int i = 1; i < input.length; i++){
            if(temp1 != input[i] && count == 1){
                temp2 = input[i];
                count++;
            } else if(count == 2 && temp1 != input[i] && temp2 != input[i]){
                answer = "No";
            }
        }
        if(count == 1){
            answer = "No";
        }

        // answer
        System.out.println(answer);

    } main {
        Scanner scan = new Scanner(System.in);

        // input
        char[] input = scan.next().toCharArray();

        // search
        char temp1 = input[0];
        char temp2 ='t';
        int count = 1;
        String answer = "Yes";
        for(int i = 1; i < input.length; i++){
            if(temp1 != input[i] && count == 1){
                temp2 = input[i];
                count++;
            } else if(count == 2 && temp1 != input[i] && temp2 != input[i]){
                answer = "No";
            }
        }
        if(count == 1){
            answer = "No";
        }

        // answer
        System.out.println(answer);

    } Scanner scan = new Scanner(System.in); scan new Scanner(System.in) char[] input = scan.next().toCharArray(); input scan.next().toCharArray() scan.next().toCharArray scan.next() scan.next scan char temp1 = input[0]; temp1 input[0] input 0 char temp2 ='t'; temp2 't' int count = 1; count 1 String answer = "Yes"; answer "Yes" for(int i = 1; i < input.length; i++){
            if(temp1 != input[i] && count == 1){
                temp2 = input[i];
                count++;
            } else if(count == 2 && temp1 != input[i] && temp2 != input[i]){
                answer = "No";
            }
        } int i = 1; int i = 1; i 1 i < input.length i input.length input input.length i++ i++ i {
            if(temp1 != input[i] && count == 1){
                temp2 = input[i];
                count++;
            } else if(count == 2 && temp1 != input[i] && temp2 != input[i]){
                answer = "No";
            }
        } {
            if(temp1 != input[i] && count == 1){
                temp2 = input[i];
                count++;
            } else if(count == 2 && temp1 != input[i] && temp2 != input[i]){
                answer = "No";
            }
        } if(temp1 != input[i] && count == 1){
                temp2 = input[i];
                count++;
            } else if(count == 2 && temp1 != input[i] && temp2 != input[i]){
                answer = "No";
            } temp1 != input[i] && count == 1 temp1 != input[i] temp1 input[i] input i count == 1 count 1 {
                temp2 = input[i];
                count++;
            } temp2 = input[i] temp2 input[i] input i count++ count if(count == 2 && temp1 != input[i] && temp2 != input[i]){
                answer = "No";
            } count == 2 && temp1 != input[i] && temp2 != input[i] count == 2 && temp1 != input[i] && temp2 != input[i] count == 2 count 2 temp1 != input[i] temp1 input[i] input i temp2 != input[i] temp2 input[i] input i {
                answer = "No";
            } answer = "No" answer "No" if(count == 1){
            answer = "No";
        } count == 1 count 1 {
            answer = "No";
        } answer = "No" answer "No" System.out.println(answer) System.out.println System.out System System.out answer String[] args args public class Main{

    public static void main(String[] args){
        Scanner scan = new Scanner(System.in);

        // input
        char[] input = scan.next().toCharArray();

        // search
        char temp1 = input[0];
        char temp2 ='t';
        int count = 1;
        String answer = "Yes";
        for(int i = 1; i < input.length; i++){
            if(temp1 != input[i] && count == 1){
                temp2 = input[i];
                count++;
            } else if(count == 2 && temp1 != input[i] && temp2 != input[i]){
                answer = "No";
            }
        }
        if(count == 1){
            answer = "No";
        }

        // answer
        System.out.println(answer);

    }
} public class Main{

    public static void main(String[] args){
        Scanner scan = new Scanner(System.in);

        // input
        char[] input = scan.next().toCharArray();

        // search
        char temp1 = input[0];
        char temp2 ='t';
        int count = 1;
        String answer = "Yes";
        for(int i = 1; i < input.length; i++){
            if(temp1 != input[i] && count == 1){
                temp2 = input[i];
                count++;
            } else if(count == 2 && temp1 != input[i] && temp2 != input[i]){
                answer = "No";
            }
        }
        if(count == 1){
            answer = "No";
        }

        // answer
        System.out.println(answer);

    }
} Main
import java.util.Scanner;

public class Main{

    public static void main(String[] args){
        Scanner scan = new Scanner(System.in);

        // input
        char[] input = scan.next().toCharArray();

        // search
        char temp1 = input[0];
        char temp2 ='t';
        int count = 1;
        String answer = "Yes";
        for(int i = 1; i < input.length; i++){
            if(temp1 != input[i] && count == 1){
                temp2 = input[i];
                count++;
            } else if(count == 2 && temp1 != input[i] && temp2 != input[i]){
                answer = "No";
            }
        }
        if(count == 1){
            answer = "No";
        }

        // answer
        System.out.println(answer);

    }
}