#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  map<char, int> my;
  for (long double i = 0; i < (long double)s.size(); i++) my[s[i]]++;
  map<char, int>::iterator it;
  if ((long double)my.size() == 1)
    cout << "No\n";
  else if ((long double)my.size() == 2) {
    long double flag = 1;
    for (it = my.begin(); it != my.end(); it++) {
      if ((it->second) < 2) flag = 0;
    }
    if (!flag)
      cout << "No\n";
    else
      cout << "Yes\n";
  } else if ((long double)my.size() == 3) {
    long double cal = (long double)my.size();
    long double cnt = 4;
    while (cal > cnt) cnt += 4;
    if (cnt == cal)
      cout << "Yes\n";
    else {
      long double flag = cnt - cal;
      for (it = my.begin(); it != my.end(); it++) {
        if ((it->second) >= 2) flag--;
      }
      if (flag <= 0)
        cout << "Yes\n";
      else
        cout << "No\n";
    }
  } else if ((long double)my.size() == 4)
    cout << "Yes\n";
  else
    cout << "No\n";
  return 0;
}
