import java.io.BufferedReader; import java.io.InputStreamReader; public class Main { public static void main(String[] args) throws Exception { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); char[] s = br.readLine().toCharArray(); br.close(); for (int i = 0; i < s.length - 2; i++) { label: for (int j = i + 2; j < s.length; j++) { int[] blank = new int[100000]; for (int k = 0; k < i; k++) { if (s[k] != ' ' && s[k] != ' ') { blank[s[k] - 'a'] = 1; } } for (int k = j; k < s.length; k++) { if (s[k] != ' ' && s[k] != ' ') { blank[s[k] - 'a'] = 1; } } for (int k = i; k < j; k++) { if ((k - i) % 2 == 0) { if (s[k] == ' ' || s[k] == ' ' || blank[s[k] - 'a'] == 1) { continue label; } else { blank[s[k] - 'a'] = 2; } } else { if (s[k] != ' ' && s[k] != ' ') { if (blank[s[k] - 'a'] == 2) { continue label; } else { blank[s[k] - 'a'] = 1; } } } } System.out.println("Yes"); return; } } System.out.println("NO"); } }