#include <bits/stdc++.h>
using namespace std;
int main() {
  int h, g, c, n, m, k, l, a[140] = {};
  string s;
  cin >> s;
  n = s.length();
  for (int i = 0; i < s.length(); i++) a[s[i]]++;
  int res = 0;
  for (int i = 0; i <= 139; i++)
    if (a[i] > 0) {
      res++;
    }
  if ((res < 2) || (n < 4) || (res > 4)) {
    printf("No");
    return 0;
  }
  int kol = res;
  if (res == 4) {
    printf("Yes");
    return 0;
  }
  res = 0;
  for (int i = 0; i <= 139; i++)
    if (a[i] > 1) {
      res++;
    }
  if ((kol == 3) && (res > 0)) {
    printf("Yes");
    return 0;
  }
  if ((kol == 2) && (res > 1)) {
    printf("Yes");
    return 0;
  }
  printf("No");
}
