#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  int l = s.length();
  int cnt[26] = {};
  int chs = 0;
  int ch = 0;
  for (int i = 0; i < l; i++) {
    if (cnt[s[i] - 'a'] == 0) chs++;
    if (cnt[s[i] - 'a'] == 1) ch++;
    cnt[s[i] - 'a']++;
  }
  if (chs == 1)
    cout << "No";
  else if (chs == 2) {
    if (ch == 2)
      cout << "Yes";
    else
      cout << "No";
  } else if (chs == 3) {
    if (ch > 0)
      cout << "Yes";
    else
      cout << "No";
  } else if (chs == 4) {
    cout << "Yes";
  } else
    cout << "No";
  return 0;
}
