#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7;
const int MAXN = 1e5 + 5;
const int INF = 0x3f3f3f3f;
const double eps = 1e-9;
int cnt[33];
int main() {
  char str[MAXN];
  char c = getchar();
  int n = 0;
  while (c > 'z' || c < 'a') {
    c = getchar();
  }
  while (c != '\n') {
    str[n++] = c;
    cnt[c - 'a']++;
    c = getchar();
  }
  int c1 = 0, c2 = 0;
  for (int i = 0; i < 26; i++) {
    if (cnt[i] > 0) c1++;
    if (cnt[i] == 1) c2++;
    ;
  }
  if (c1 >= 2 && c1 <= 4) {
    if (c1 == 4)
      printf("Yes\n");
    else if (c1 == 3 && strlen(str) >= 4) {
      printf("Yes\n");
    } else if (c1 == 2 && c2 == 0)
      printf("Yes\n");
    else
      printf("No\n");
  } else {
    printf("NO\n");
  }
  return 0;
}
