#include <bits/stdc++.h>
using namespace std;
int freq[29] = {0}, cnt = 0, gre = 0;
string A;
int main() {
  cin >> A;
  for (int i = 0; i < A.size(); i++) {
    freq[A[i] - 'a']++;
  }
  for (int i = 0; i < 26; i++) {
    if (freq[i] != 0) {
      cnt++;
      if (freq[i] > 1) gre++;
    }
  }
  if (cnt == 2 && gre == 2)
    cout << "Yes\n";
  else if (cnt == 3 && gre >= 1)
    cout << "Yes\n";
  else if (cnt == 4)
    cout << "Yes\n";
  else
    cout << "No\n";
}
