#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  int arr[200], diff = 0;
  int index[10];
  for (int i = 0; i < 200; i++) arr[i] = 0;
  int l = s.length();
  if (l < 4) {
    cout << "No";
    return 0;
  }
  for (int i = 0; i < l; i++) {
    arr[s[i]]++;
  }
  for (int i = 0; i < 200; i++) {
    if (arr[i] > 0) {
      index[diff] = i;
      diff++;
    }
  }
  if (diff == 1)
    cout << "No";
  else if (diff == 2) {
    if ((arr[index[0]] == 1) || (arr[index[1]] == 1))
      cout << "No";
    else
      cout << "Yes";
  } else if (diff == 3) {
    if ((arr[index[0]] > 1) || (arr[index[1]] > 1) || (arr[index[2]] > 1))
      cout << "Yes";
    else
      cout << "No";
  } else if (diff == 4)
    cout << "Yes";
  else
    cout << "No";
}
