#include <bits/stdc++.h>
using namespace std;
string S;
int main() {
  cin.tie(NULL), cout.tie(NULL);
  cin >> S;
  map<char, int> M;
  for (int i = 0; i < S.size(); i++) M[S[i]]++;
  if (M.size() > 4 || M.size() < 2) {
    cout << "No\n";
    return 0;
  }
  if (M.size() == 4) {
    cout << "Yes\n";
    return 0;
  }
  if (M.size() == 3) {
    if (S.size() == 3)
      cout << "No\n";
    else
      cout << "Yes\n";
    return 0;
  }
  map<char, int>::iterator it = M.begin();
  if (it->second > 1) {
    it++;
    if (it->second > 1) {
      cout << "Yes\n";
      return 0;
    }
  }
  cout << "No\n";
  return 0;
}
