import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String S = sc.next();
        sc.close();
        if (Judge(S) == 2) {
            System.out.println("Yes");
        } else {
            System.out.println("No");
        }
    }
    public static int Judge(String S) {
        if (S.length() < 2) {
            return 0;
        }
        int num = 0;
        String remain = "";
        for (int i = 1; i < S.length(); i++) {
            if (S.charAt(0) == S.charAt(i)) {
                num = 1;
            }
            else {
                remain += S.charAt(i);
            }
        }
        if (remain.length() != 0) {
            return num + Judge(remain);
        }
        return num;
    }
} import java.util.*; util.* java public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String S = sc.next();
        sc.close();
        if (Judge(S) == 2) {
            System.out.println("Yes");
        } else {
            System.out.println("No");
        }
    }
    public static int Judge(String S) {
        if (S.length() < 2) {
            return 0;
        }
        int num = 0;
        String remain = "";
        for (int i = 1; i < S.length(); i++) {
            if (S.charAt(0) == S.charAt(i)) {
                num = 1;
            }
            else {
                remain += S.charAt(i);
            }
        }
        if (remain.length() != 0) {
            return num + Judge(remain);
        }
        return num;
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String S = sc.next();
        sc.close();
        if (Judge(S) == 2) {
            System.out.println("Yes");
        } else {
            System.out.println("No");
        }
    } main {
        Scanner sc = new Scanner(System.in);
        String S = sc.next();
        sc.close();
        if (Judge(S) == 2) {
            System.out.println("Yes");
        } else {
            System.out.println("No");
        }
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String S = sc.next(); S sc.next() sc.next sc sc.close() sc.close sc if (Judge(S) == 2) {
            System.out.println("Yes");
        } else {
            System.out.println("No");
        } Judge(S) == 2 Judge(S) Judge S 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 static int Judge(String S) {
        if (S.length() < 2) {
            return 0;
        }
        int num = 0;
        String remain = "";
        for (int i = 1; i < S.length(); i++) {
            if (S.charAt(0) == S.charAt(i)) {
                num = 1;
            }
            else {
                remain += S.charAt(i);
            }
        }
        if (remain.length() != 0) {
            return num + Judge(remain);
        }
        return num;
    } Judge {
        if (S.length() < 2) {
            return 0;
        }
        int num = 0;
        String remain = "";
        for (int i = 1; i < S.length(); i++) {
            if (S.charAt(0) == S.charAt(i)) {
                num = 1;
            }
            else {
                remain += S.charAt(i);
            }
        }
        if (remain.length() != 0) {
            return num + Judge(remain);
        }
        return num;
    } if (S.length() < 2) {
            return 0;
        } S.length() < 2 S.length() S.length S 2 {
            return 0;
        } return 0; 0 int num = 0; num 0 String remain = ""; remain "" for (int i = 1; i < S.length(); i++) {
            if (S.charAt(0) == S.charAt(i)) {
                num = 1;
            }
            else {
                remain += S.charAt(i);
            }
        } int i = 1; int i = 1; i 1 i < S.length() i S.length() S.length S i++ i++ i {
            if (S.charAt(0) == S.charAt(i)) {
                num = 1;
            }
            else {
                remain += S.charAt(i);
            }
        } {
            if (S.charAt(0) == S.charAt(i)) {
                num = 1;
            }
            else {
                remain += S.charAt(i);
            }
        } if (S.charAt(0) == S.charAt(i)) {
                num = 1;
            }
            else {
                remain += S.charAt(i);
            } S.charAt(0) == S.charAt(i) S.charAt(0) S.charAt S 0 S.charAt(i) S.charAt S i {
                num = 1;
            } num = 1 num 1 {
                remain += S.charAt(i);
            } remain += S.charAt(i) remain S.charAt(i) S.charAt S i if (remain.length() != 0) {
            return num + Judge(remain);
        } remain.length() != 0 remain.length() remain.length remain 0 {
            return num + Judge(remain);
        } return num + Judge(remain); num + Judge(remain) num Judge(remain) Judge remain return num; num String S S public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String S = sc.next();
        sc.close();
        if (Judge(S) == 2) {
            System.out.println("Yes");
        } else {
            System.out.println("No");
        }
    }
    public static int Judge(String S) {
        if (S.length() < 2) {
            return 0;
        }
        int num = 0;
        String remain = "";
        for (int i = 1; i < S.length(); i++) {
            if (S.charAt(0) == S.charAt(i)) {
                num = 1;
            }
            else {
                remain += S.charAt(i);
            }
        }
        if (remain.length() != 0) {
            return num + Judge(remain);
        }
        return num;
    }
} public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String S = sc.next();
        sc.close();
        if (Judge(S) == 2) {
            System.out.println("Yes");
        } else {
            System.out.println("No");
        }
    }
    public static int Judge(String S) {
        if (S.length() < 2) {
            return 0;
        }
        int num = 0;
        String remain = "";
        for (int i = 1; i < S.length(); i++) {
            if (S.charAt(0) == S.charAt(i)) {
                num = 1;
            }
            else {
                remain += S.charAt(i);
            }
        }
        if (remain.length() != 0) {
            return num + Judge(remain);
        }
        return num;
    }
} Main
import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String S = sc.next();
        sc.close();
        if (Judge(S) == 2) {
            System.out.println("Yes");
        } else {
            System.out.println("No");
        }
    }
    public static int Judge(String S) {
        if (S.length() < 2) {
            return 0;
        }
        int num = 0;
        String remain = "";
        for (int i = 1; i < S.length(); i++) {
            if (S.charAt(0) == S.charAt(i)) {
                num = 1;
            }
            else {
                remain += S.charAt(i);
            }
        }
        if (remain.length() != 0) {
            return num + Judge(remain);
        }
        return num;
    }
}
