#include <bits/stdc++.h>
int c[50];
char s[200000];
int len;
int main() {
  scanf("%s", s);
  len = strlen(s);
  for (int i = 0; i < len; ++i) c[s[i] - 'a'] += 1;
  int cate = 0;
  for (int i = 0; i < 26; ++i)
    if (c[i] > 0) ++cate;
  if (cate == 2) {
    int num = 0;
    for (int i = 0; i < 26; ++i)
      if (c[i] == 1) {
        printf("No\n");
        return 0;
      }
    printf("Yes\n");
    return 0;
  }
  if (cate == 3) {
    int num = 0;
    for (int i = 0; i < 26; ++i)
      if (c[i] > num) num = c[i];
    if (num > 1)
      printf("Yes\n");
    else
      printf("No\n");
    return 0;
  }
  if (cate == 4) {
    printf("Yes\n");
    return 0;
  }
  printf("No\n");
  return 0;
}
