import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        // Your code here!
        Scanner sc = new Scanner(System.in);
        String str = sc.next();
        
        if (str.charAt(0) == str.charAt(1) && str.charAt(2) == str.charAt(3) && str.charAt(1) == str.charAt(2)) {
            System.out.println("No");
        } else if (str.charAt(0) == str.charAt(1) && str.charAt(2) == str.charAt(3)) {
                System.out.println("Yes");
        } else if (str.charAt(0) == str.charAt(2) && str.charAt(1) == str.charAt(3)) {
                System.out.println("Yes");
        } else if (str.charAt(0) == str.charAt(3) && str.charAt(1) == str.charAt(2)) {
                System.out.println("Yes");
        } else {
                System.out.println("No");
        }
    }
} import java.util.*; util.* java public class Main {
    public static void main(String[] args) throws Exception {
        // Your code here!
        Scanner sc = new Scanner(System.in);
        String str = sc.next();
        
        if (str.charAt(0) == str.charAt(1) && str.charAt(2) == str.charAt(3) && str.charAt(1) == str.charAt(2)) {
            System.out.println("No");
        } else if (str.charAt(0) == str.charAt(1) && str.charAt(2) == str.charAt(3)) {
                System.out.println("Yes");
        } else if (str.charAt(0) == str.charAt(2) && str.charAt(1) == str.charAt(3)) {
                System.out.println("Yes");
        } else if (str.charAt(0) == str.charAt(3) && str.charAt(1) == str.charAt(2)) {
                System.out.println("Yes");
        } else {
                System.out.println("No");
        }
    }
} Main public static void main(String[] args) throws Exception {
        // Your code here!
        Scanner sc = new Scanner(System.in);
        String str = sc.next();
        
        if (str.charAt(0) == str.charAt(1) && str.charAt(2) == str.charAt(3) && str.charAt(1) == str.charAt(2)) {
            System.out.println("No");
        } else if (str.charAt(0) == str.charAt(1) && str.charAt(2) == str.charAt(3)) {
                System.out.println("Yes");
        } else if (str.charAt(0) == str.charAt(2) && str.charAt(1) == str.charAt(3)) {
                System.out.println("Yes");
        } else if (str.charAt(0) == str.charAt(3) && str.charAt(1) == str.charAt(2)) {
                System.out.println("Yes");
        } else {
                System.out.println("No");
        }
    } main {
        // Your code here!
        Scanner sc = new Scanner(System.in);
        String str = sc.next();
        
        if (str.charAt(0) == str.charAt(1) && str.charAt(2) == str.charAt(3) && str.charAt(1) == str.charAt(2)) {
            System.out.println("No");
        } else if (str.charAt(0) == str.charAt(1) && str.charAt(2) == str.charAt(3)) {
                System.out.println("Yes");
        } else if (str.charAt(0) == str.charAt(2) && str.charAt(1) == str.charAt(3)) {
                System.out.println("Yes");
        } else if (str.charAt(0) == str.charAt(3) && str.charAt(1) == str.charAt(2)) {
                System.out.println("Yes");
        } else {
                System.out.println("No");
        }
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String str = sc.next(); str sc.next() sc.next sc if (str.charAt(0) == str.charAt(1) && str.charAt(2) == str.charAt(3) && str.charAt(1) == str.charAt(2)) {
            System.out.println("No");
        } else if (str.charAt(0) == str.charAt(1) && str.charAt(2) == str.charAt(3)) {
                System.out.println("Yes");
        } else if (str.charAt(0) == str.charAt(2) && str.charAt(1) == str.charAt(3)) {
                System.out.println("Yes");
        } else if (str.charAt(0) == str.charAt(3) && str.charAt(1) == str.charAt(2)) {
                System.out.println("Yes");
        } else {
                System.out.println("No");
        } str.charAt(0) == str.charAt(1) && str.charAt(2) == str.charAt(3) && str.charAt(1) == str.charAt(2) str.charAt(0) == str.charAt(1) && str.charAt(2) == str.charAt(3) && str.charAt(1) == str.charAt(2) str.charAt(0) == str.charAt(1) str.charAt(0) str.charAt str 0 str.charAt(1) str.charAt str 1 str.charAt(2) == str.charAt(3) str.charAt(2) str.charAt str 2 str.charAt(3) str.charAt str 3 str.charAt(1) == str.charAt(2) str.charAt(1) str.charAt str 1 str.charAt(2) str.charAt str 2 {
            System.out.println("No");
        } System.out.println("No") System.out.println System.out System System.out "No" if (str.charAt(0) == str.charAt(1) && str.charAt(2) == str.charAt(3)) {
                System.out.println("Yes");
        } else if (str.charAt(0) == str.charAt(2) && str.charAt(1) == str.charAt(3)) {
                System.out.println("Yes");
        } else if (str.charAt(0) == str.charAt(3) && str.charAt(1) == str.charAt(2)) {
                System.out.println("Yes");
        } else {
                System.out.println("No");
        } str.charAt(0) == str.charAt(1) && str.charAt(2) == str.charAt(3) str.charAt(0) == str.charAt(1) str.charAt(0) str.charAt str 0 str.charAt(1) str.charAt str 1 str.charAt(2) == str.charAt(3) str.charAt(2) str.charAt str 2 str.charAt(3) str.charAt str 3 {
                System.out.println("Yes");
        } System.out.println("Yes") System.out.println System.out System System.out "Yes" if (str.charAt(0) == str.charAt(2) && str.charAt(1) == str.charAt(3)) {
                System.out.println("Yes");
        } else if (str.charAt(0) == str.charAt(3) && str.charAt(1) == str.charAt(2)) {
                System.out.println("Yes");
        } else {
                System.out.println("No");
        } str.charAt(0) == str.charAt(2) && str.charAt(1) == str.charAt(3) str.charAt(0) == str.charAt(2) str.charAt(0) str.charAt str 0 str.charAt(2) str.charAt str 2 str.charAt(1) == str.charAt(3) str.charAt(1) str.charAt str 1 str.charAt(3) str.charAt str 3 {
                System.out.println("Yes");
        } System.out.println("Yes") System.out.println System.out System System.out "Yes" if (str.charAt(0) == str.charAt(3) && str.charAt(1) == str.charAt(2)) {
                System.out.println("Yes");
        } else {
                System.out.println("No");
        } str.charAt(0) == str.charAt(3) && str.charAt(1) == str.charAt(2) str.charAt(0) == str.charAt(3) str.charAt(0) str.charAt str 0 str.charAt(3) str.charAt str 3 str.charAt(1) == str.charAt(2) str.charAt(1) str.charAt str 1 str.charAt(2) str.charAt str 2 {
                System.out.println("Yes");
        } System.out.println("Yes") System.out.println System.out System System.out "Yes" {
                System.out.println("No");
        } System.out.println("No") System.out.println System.out System System.out "No" String[] args args public class Main {
    public static void main(String[] args) throws Exception {
        // Your code here!
        Scanner sc = new Scanner(System.in);
        String str = sc.next();
        
        if (str.charAt(0) == str.charAt(1) && str.charAt(2) == str.charAt(3) && str.charAt(1) == str.charAt(2)) {
            System.out.println("No");
        } else if (str.charAt(0) == str.charAt(1) && str.charAt(2) == str.charAt(3)) {
                System.out.println("Yes");
        } else if (str.charAt(0) == str.charAt(2) && str.charAt(1) == str.charAt(3)) {
                System.out.println("Yes");
        } else if (str.charAt(0) == str.charAt(3) && str.charAt(1) == str.charAt(2)) {
                System.out.println("Yes");
        } else {
                System.out.println("No");
        }
    }
} public class Main {
    public static void main(String[] args) throws Exception {
        // Your code here!
        Scanner sc = new Scanner(System.in);
        String str = sc.next();
        
        if (str.charAt(0) == str.charAt(1) && str.charAt(2) == str.charAt(3) && str.charAt(1) == str.charAt(2)) {
            System.out.println("No");
        } else if (str.charAt(0) == str.charAt(1) && str.charAt(2) == str.charAt(3)) {
                System.out.println("Yes");
        } else if (str.charAt(0) == str.charAt(2) && str.charAt(1) == str.charAt(3)) {
                System.out.println("Yes");
        } else if (str.charAt(0) == str.charAt(3) && str.charAt(1) == str.charAt(2)) {
                System.out.println("Yes");
        } else {
                System.out.println("No");
        }
    }
} Main
import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        // Your code here!
        Scanner sc = new Scanner(System.in);
        String str = sc.next();
        
        if (str.charAt(0) == str.charAt(1) && str.charAt(2) == str.charAt(3) && str.charAt(1) == str.charAt(2)) {
            System.out.println("No");
        } else if (str.charAt(0) == str.charAt(1) && str.charAt(2) == str.charAt(3)) {
                System.out.println("Yes");
        } else if (str.charAt(0) == str.charAt(2) && str.charAt(1) == str.charAt(3)) {
                System.out.println("Yes");
        } else if (str.charAt(0) == str.charAt(3) && str.charAt(1) == str.charAt(2)) {
                System.out.println("Yes");
        } else {
                System.out.println("No");
        }
    }
}
