#include <bits/stdc++.h>
using namespace std;
int main() {
  string x;
  cin >> x;
  int i;
  map<char, int> m;
  for (i = 0; i < x.size(); i++) {
    m[x[i]]++;
  }
  int t = 0, h = 0;
  if (m.size() >= 5)
    cout << "No" << endl;
  else if (m.size() == 4)
    cout << "Yes" << endl;
  else if (m.size() == 3) {
    map<char, int>::iterator it;
    for (it = m.begin(); it != m.end(); it++) {
      if ((it->second) >= 2) t++;
    }
    if (t >= 1)
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  } else if (m.size() == 2) {
    map<char, int>::iterator it;
    for (it = m.begin(); it != m.end(); it++) {
      if ((it->second) >= 2) t++;
    }
    if (t >= 2)
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  } else {
    cout << "No" << endl;
  }
}
