#include <bits/stdc++.h>
using namespace std;
string s;
int a[50], t, m;
int main() {
  cin >> s;
  for (int i = 0; i < s.size(); i++) {
    if (a[s[i] - 'a'] == 0) {
      a[s[i] - 'a'] = 1;
      t++;
      m++;
    } else {
      a[s[i] - 'a']++;
      if (a[s[i] - 'a'] == 2) m--;
    }
  }
  if (t > 4) {
    cout << "No" << endl;
  } else if (t == 4) {
    cout << "Yes" << endl;
  } else if (t == 3) {
    if (s.size() == 3)
      cout << "No" << endl;
    else
      cout << "Yes" << endl;
  } else if (t == 2) {
    if (m > 0)
      cout << "No" << endl;
    else
      cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
  return 0;
}
