#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  int n = s.length();
  if (n < 4)
    cout << "No";
  else {
    int a[26] = {0};
    int count = 0;
    for (int i = 0; i < n; i++) {
      if (a[s[i] - 97] == 0) count++;
      a[s[i] - 97]++;
    }
    switch (count) {
      case 1:
        cout << "No";
        break;
      case 2:
        for (int i = 0; i < 26; i++) {
          if (a[i] == 1) {
            cout << "No";
            exit(0);
          }
        }
        cout << "Yes";
        break;
      case 3:
        cout << "Yes";
        break;
      case 4:
        cout << "Yes";
        break;
      default:
        cout << "No";
    }
  }
}
