#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  string str;
  cin >> str;
  long long n = str.length();
  long long cnt[26] = {0};
  for (long long i = 0; i < n; i++) cnt[str[i] - 'a']++;
  long long c = 0;
  long long ct = 0;
  for (long long i = 0; i < 26; i++) c += (cnt[i] > 0), ct += (cnt[i] >= 2);
  if (c <= 1 || c >= 5) {
    cout << "No" << endl;
    return 0;
  }
  if (c == 2) {
    if (ct == 2)
      cout << "Yes" << endl;
    else if (ct == 0 || ct == 1)
      cout << "No" << endl;
  }
  if (c == 3) {
    if (ct == 0)
      cout << "No" << endl;
    else
      cout << "Yes" << endl;
  }
  if (c == 4) cout << "Yes" << endl;
}
