#include <bits/stdc++.h>
using namespace std;
long long final[30];
long long a[30];
int main() {
  char s[100001];
  scanf("%s", s);
  long long temp = 0;
  long long countr = 0;
  long long countr1 = 0;
  for (int i = 0; s[i] != '\0'; i++) {
    a[s[i] - 'a']++;
    if (final[s[i] - 'a'] == 0) {
      temp++;
      final[s[i] - 'a'] = 1;
    }
  }
  if (temp == 1) {
    printf("No\n");
    return 0;
  }
  if (temp == 2) {
    for (int i = 0; i < 30; i++) {
      if (a[i] > 0 && a[i] <= 1) {
        countr1 = 1;
        break;
      }
    }
    if (countr1 == 0) {
      printf("Yes\n");
      return 0;
    } else {
      printf("No\n");
      return 0;
    }
  }
  if (temp == 3) {
    for (int i = 0; i < 30; i++) {
      if (a[i] > 1) {
        countr = 1;
        printf("Yes\n");
        return 0;
      }
    }
    if (countr == 0) printf("No\n");
    return 0;
  }
  if (temp == 4) {
    printf("Yes\n");
    return 0;
  }
  if (temp >= 5) {
    printf("No\n");
    return 0;
  }
  return 0;
}
