import java.util.*;
import java.util.Collections;

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

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    String S = sc.next();
    int cnt = 0;
    for (int i = 0; i < S.length(); i++) {
      for (int j = 0; j < S.length(); j++) {
        if (S.charAt(i) == S.charAt(j)) {
          cnt++;
        }
      }
    }
    if (cnt == 8) {
      System.out.println("Yes");
    } else {
      System.out.println("No");
    }
  }
}
