import java.util.*;
public class Main{
  public static void main(String args[]){
    Scanner sc = new Scanner(System.in);
    String s = sc.next();
    String[] ary = s.split("");
    int a = 0;
    s = ary[0];
    for( a = 1;a<4;a++){
      if(s.equals(ary[a])){
        break;
      }
    }
    switch(a){  
    case 1:if(!ary[2].equals(s)&&ary[2].equals(ary[3])){
        System.out.println("Yes");
      }else{
        System.out.println("No");     
      }break;
    case 2:if(!ary[1].equals(s)&&ary[1].equals(ary[3])){
        System.out.println("Yes");
      }else{
        System.out.println("No");     
      }break;
    case 3:if(!ary[1].equals(s)&&ary[2].equals(ary[1])){
        System.out.println("Yes");
      }else{
        System.out.println("No");     
      }break;
      default:System.out.println("No");   
    }
  } 
} import java.util.*; util.* java public class Main{
  public static void main(String args[]){
    Scanner sc = new Scanner(System.in);
    String s = sc.next();
    String[] ary = s.split("");
    int a = 0;
    s = ary[0];
    for( a = 1;a<4;a++){
      if(s.equals(ary[a])){
        break;
      }
    }
    switch(a){  
    case 1:if(!ary[2].equals(s)&&ary[2].equals(ary[3])){
        System.out.println("Yes");
      }else{
        System.out.println("No");     
      }break;
    case 2:if(!ary[1].equals(s)&&ary[1].equals(ary[3])){
        System.out.println("Yes");
      }else{
        System.out.println("No");     
      }break;
    case 3:if(!ary[1].equals(s)&&ary[2].equals(ary[1])){
        System.out.println("Yes");
      }else{
        System.out.println("No");     
      }break;
      default:System.out.println("No");   
    }
  } 
} Main public static void main(String args[]){
    Scanner sc = new Scanner(System.in);
    String s = sc.next();
    String[] ary = s.split("");
    int a = 0;
    s = ary[0];
    for( a = 1;a<4;a++){
      if(s.equals(ary[a])){
        break;
      }
    }
    switch(a){  
    case 1:if(!ary[2].equals(s)&&ary[2].equals(ary[3])){
        System.out.println("Yes");
      }else{
        System.out.println("No");     
      }break;
    case 2:if(!ary[1].equals(s)&&ary[1].equals(ary[3])){
        System.out.println("Yes");
      }else{
        System.out.println("No");     
      }break;
    case 3:if(!ary[1].equals(s)&&ary[2].equals(ary[1])){
        System.out.println("Yes");
      }else{
        System.out.println("No");     
      }break;
      default:System.out.println("No");   
    }
  } main {
    Scanner sc = new Scanner(System.in);
    String s = sc.next();
    String[] ary = s.split("");
    int a = 0;
    s = ary[0];
    for( a = 1;a<4;a++){
      if(s.equals(ary[a])){
        break;
      }
    }
    switch(a){  
    case 1:if(!ary[2].equals(s)&&ary[2].equals(ary[3])){
        System.out.println("Yes");
      }else{
        System.out.println("No");     
      }break;
    case 2:if(!ary[1].equals(s)&&ary[1].equals(ary[3])){
        System.out.println("Yes");
      }else{
        System.out.println("No");     
      }break;
    case 3:if(!ary[1].equals(s)&&ary[2].equals(ary[1])){
        System.out.println("Yes");
      }else{
        System.out.println("No");     
      }break;
      default: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 String[] ary = s.split(""); ary s.split("") s.split s "" int a = 0; a 0 s = ary[0] s ary[0] ary 0 for( a = 1;a<4;a++){
      if(s.equals(ary[a])){
        break;
      }
    } a = 1; a = 1 a 1 a<4 a 4 a++ a++ a {
      if(s.equals(ary[a])){
        break;
      }
    } {
      if(s.equals(ary[a])){
        break;
      }
    } if(s.equals(ary[a])){
        break;
      } s.equals(ary[a]) s.equals s ary[a] ary a {
        break;
      } break; switch(a){  
    case 1:if(!ary[2].equals(s)&&ary[2].equals(ary[3])){
        System.out.println("Yes");
      }else{
        System.out.println("No");     
      }break;
    case 2:if(!ary[1].equals(s)&&ary[1].equals(ary[3])){
        System.out.println("Yes");
      }else{
        System.out.println("No");     
      }break;
    case 3:if(!ary[1].equals(s)&&ary[2].equals(ary[1])){
        System.out.println("Yes");
      }else{
        System.out.println("No");     
      }break;
      default:System.out.println("No");   
    } a case 1: 1 case 1: if(!ary[2].equals(s)&&ary[2].equals(ary[3])){
        System.out.println("Yes");
      }else{
        System.out.println("No");     
      } !ary[2].equals(s)&&ary[2].equals(ary[3]) !ary[2].equals(s) ary[2].equals(s) ary[2].equals ary[2] ary 2 s ary[2].equals(ary[3]) ary[2].equals ary[2] ary 2 ary[3] ary 3 {
        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" break; case 2: 2 case 2: if(!ary[1].equals(s)&&ary[1].equals(ary[3])){
        System.out.println("Yes");
      }else{
        System.out.println("No");     
      } !ary[1].equals(s)&&ary[1].equals(ary[3]) !ary[1].equals(s) ary[1].equals(s) ary[1].equals ary[1] ary 1 s ary[1].equals(ary[3]) ary[1].equals ary[1] ary 1 ary[3] ary 3 {
        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" break; case 3: 3 case 3: if(!ary[1].equals(s)&&ary[2].equals(ary[1])){
        System.out.println("Yes");
      }else{
        System.out.println("No");     
      } !ary[1].equals(s)&&ary[2].equals(ary[1]) !ary[1].equals(s) ary[1].equals(s) ary[1].equals ary[1] ary 1 s ary[2].equals(ary[1]) ary[2].equals ary[2] ary 2 ary[1] ary 1 {
        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" break; default: default: 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();
    String[] ary = s.split("");
    int a = 0;
    s = ary[0];
    for( a = 1;a<4;a++){
      if(s.equals(ary[a])){
        break;
      }
    }
    switch(a){  
    case 1:if(!ary[2].equals(s)&&ary[2].equals(ary[3])){
        System.out.println("Yes");
      }else{
        System.out.println("No");     
      }break;
    case 2:if(!ary[1].equals(s)&&ary[1].equals(ary[3])){
        System.out.println("Yes");
      }else{
        System.out.println("No");     
      }break;
    case 3:if(!ary[1].equals(s)&&ary[2].equals(ary[1])){
        System.out.println("Yes");
      }else{
        System.out.println("No");     
      }break;
      default:System.out.println("No");   
    }
  } 
} public class Main{
  public static void main(String args[]){
    Scanner sc = new Scanner(System.in);
    String s = sc.next();
    String[] ary = s.split("");
    int a = 0;
    s = ary[0];
    for( a = 1;a<4;a++){
      if(s.equals(ary[a])){
        break;
      }
    }
    switch(a){  
    case 1:if(!ary[2].equals(s)&&ary[2].equals(ary[3])){
        System.out.println("Yes");
      }else{
        System.out.println("No");     
      }break;
    case 2:if(!ary[1].equals(s)&&ary[1].equals(ary[3])){
        System.out.println("Yes");
      }else{
        System.out.println("No");     
      }break;
    case 3:if(!ary[1].equals(s)&&ary[2].equals(ary[1])){
        System.out.println("Yes");
      }else{
        System.out.println("No");     
      }break;
      default:System.out.println("No");   
    }
  } 
} Main
import java.util.*;
public class Main{
  public static void main(String args[]){
    Scanner sc = new Scanner(System.in);
    String s = sc.next();
    String[] ary = s.split("");
    int a = 0;
    s = ary[0];
    for( a = 1;a<4;a++){
      if(s.equals(ary[a])){
        break;
      }
    }
    switch(a){  
    case 1:if(!ary[2].equals(s)&&ary[2].equals(ary[3])){
        System.out.println("Yes");
      }else{
        System.out.println("No");     
      }break;
    case 2:if(!ary[1].equals(s)&&ary[1].equals(ary[3])){
        System.out.println("Yes");
      }else{
        System.out.println("No");     
      }break;
    case 3:if(!ary[1].equals(s)&&ary[2].equals(ary[1])){
        System.out.println("Yes");
      }else{
        System.out.println("No");     
      }break;
      default:System.out.println("No");   
    }
  } 
}