#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  map<char, int> m;
  vector<int> v;
  for (int i = 0; i < s.size(); i++) {
    m[s[i]]++;
  }
  map<char, int>::iterator it = m.begin();
  while (it != m.end()) {
    v.push_back((*it).second);
    it++;
  }
  if (v.size() > 4 || v.size() == 1) {
    cout << "No";
  } else if (v.size() == 4) {
    cout << "Yes";
  } else if (v.size() == 3) {
    if (v[0] > 1 || v[1] > 1 || v[2] > 1)
      cout << "Yes";
    else
      cout << "No";
  } else if (v.size() == 2) {
    if (v[0] > 1 && v[1] > 1)
      cout << "Yes";
    else
      cout << "No";
  }
  return 0;
}
