#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(0);
  string s;
  cin >> s;
  if (s.length() <= 3) {
    cout << "No";
    return 0;
  }
  long long c = 0;
  bool b[26] = {false};
  for (long long i = 0; i < s.length(); i++) {
    if (!b[s[i] - 97]) {
      c++;
      b[s[i] - 97] = true;
    }
  }
  if (c > 4 || c == 1) {
    cout << "No";
    return 0;
  }
  if (c == 2) {
    long long a = 0, b = 0;
    char ch = s[0];
    for (long long i = 0; i < s.length(); i++) {
      if (s[i] == ch)
        a++;
      else
        b++;
    }
    if (a == 1 || b == 1) {
      cout << "No";
      return 0;
    }
  }
  cout << "Yes";
}
