#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  int alpha[26], kitta = 0;
  for (int i = 0; i < 26; i++) alpha[i] = 0;
  for (int i = 0; i < s.length(); i++) {
    alpha[s[i] - 'a']++;
    if (alpha[s[i] - 'a'] == 1) kitta++;
  }
  if (kitta > 4 || kitta < 2) {
    cout << "No";
    return 0;
  }
  for (int i = 0; i < s.length(); i++) {
    if (alpha[s[i] - 'a'] > 1) {
      kitta++;
      alpha[s[i] - 'a'] = 1;
    }
  }
  if (kitta > 3)
    cout << "Yes";
  else
    cout << "No";
  return 0;
}
