#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  int ch[26] = {0}, a = 0, b = 0;
  for (int i = 0; s[i]; i++) ch[s[i] - 'a']++;
  for (int i = 0; i < 26; i++) {
    if (ch[i] > 0) a++;
    if (ch[i] > 1) b++;
  }
  std::cout << ((a <= 4 && a + b >= 4) ? "Yes" : "NO");
  return 0;
}
