
import java.util.Arrays;
import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;

/**
 * @author author
 *
 */
public class Main {

  /**
   * @param args
   */
  public static void main(String[] args) {

    Scanner sc = new Scanner(System.in);
    Set<String> judge = new HashSet<>(Arrays.asList(sc.next().split("")));

    if (judge.size() == 2) {
      System.out.println("Yes");
    } else {
      System.out.println("No");
    }

  }

} import java.util.Arrays; Arrays java.util import java.util.HashSet; HashSet java.util import java.util.Scanner; Scanner java.util import java.util.Set; Set java.util public class Main {

  /**
   * @param args
   */
  public static void main(String[] args) {

    Scanner sc = new Scanner(System.in);
    Set<String> judge = new HashSet<>(Arrays.asList(sc.next().split("")));

    if (judge.size() == 2) {
      System.out.println("Yes");
    } else {
      System.out.println("No");
    }

  }

} Main /**
   * @param args
   */
  public static void main(String[] args) {

    Scanner sc = new Scanner(System.in);
    Set<String> judge = new HashSet<>(Arrays.asList(sc.next().split("")));

    if (judge.size() == 2) {
      System.out.println("Yes");
    } else {
      System.out.println("No");
    }

  } main {

    Scanner sc = new Scanner(System.in);
    Set<String> judge = new HashSet<>(Arrays.asList(sc.next().split("")));

    if (judge.size() == 2) {
      System.out.println("Yes");
    } else {
      System.out.println("No");
    }

  } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) Set<String> judge = new HashSet<>(Arrays.asList(sc.next().split(""))); judge new HashSet<>(Arrays.asList(sc.next().split(""))) if (judge.size() == 2) {
      System.out.println("Yes");
    } else {
      System.out.println("No");
    } judge.size() == 2 judge.size() judge.size judge 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 {

  /**
   * @param args
   */
  public static void main(String[] args) {

    Scanner sc = new Scanner(System.in);
    Set<String> judge = new HashSet<>(Arrays.asList(sc.next().split("")));

    if (judge.size() == 2) {
      System.out.println("Yes");
    } else {
      System.out.println("No");
    }

  }

} public class Main {

  /**
   * @param args
   */
  public static void main(String[] args) {

    Scanner sc = new Scanner(System.in);
    Set<String> judge = new HashSet<>(Arrays.asList(sc.next().split("")));

    if (judge.size() == 2) {
      System.out.println("Yes");
    } else {
      System.out.println("No");
    }

  }

} Main

import java.util.Arrays;
import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;

/**
 * @author author
 *
 */
public class Main {

  /**
   * @param args
   */
  public static void main(String[] args) {

    Scanner sc = new Scanner(System.in);
    Set<String> judge = new HashSet<>(Arrays.asList(sc.next().split("")));

    if (judge.size() == 2) {
      System.out.println("Yes");
    } else {
      System.out.println("No");
    }

  }

}
