#include <bits/stdc++.h>
using namespace std;
int main() {
  bool yes = false;
  setlocale(LC_ALL, "rus");
  string str;
  set<char> arr;
  set<char>::iterator it;
  multiset<char> arr2;
  int b;
  cin >> str;
  for (int i = 0; i < str.size(); i++) {
    arr.insert(str[i]);
    arr2.insert(str[i]);
  };
  if (arr.size() >= 5 || arr.size() == 1)
    cout << "No";
  else {
    if (arr.size() == 2) {
      for (it = arr.begin(); it != arr.end(); it++)
        if (arr2.count(*it) == 1) {
          yes = true;
          cout << "No";
          break;
        }
      if (!yes) cout << "Yes";
    } else if (arr.size() == 3) {
      if (str.size() != 3)
        cout << "Yes";
      else
        cout << "No";
    } else
      cout << "Yes";
  }
}
