#include <bits/stdc++.h>
using namespace std;
int main() {
  static char s[1000000];
  static int a[100];
  scanf("%s", s);
  int len = strlen(s);
  for (int i = 0; i < len; i++) {
    a[s[i] - 'a']++;
  }
  int tot = 0, mn = 1e9, sum = 0;
  for (int i = 0; i < 26; i++) {
    if (a[i]) {
      tot++;
      mn = min(mn, a[i]);
      sum += a[i];
    }
  }
  if (tot == 1) puts("No");
  if (tot == 2) {
    if (mn == 1)
      puts("No");
    else
      puts("Yes");
  }
  if (tot == 3) {
    if (sum >= 4)
      puts("Yes");
    else
      puts("No");
  }
  if (tot == 4) puts("Yes");
  if (tot > 4) puts("No");
  return 0;
}
