#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e3 + 10;
const int mod = 1e9 + 7;
int letter[30];
int main() {
  string s;
  int times = 0;
  int cnt = 0;
  cin >> s;
  for (char i : s) {
    letter[i - 'a']++;
  }
  for (int i = 'a'; i <= 'z'; i++) {
    if (letter[i - 'a'] > 0) {
      cnt++;
    }
    if (letter[i - 'a'] > 1) {
      times++;
    }
  }
  if (cnt <= 4 && times + cnt >= 4) {
    cout << "Yes";
  } else {
    cout << "No";
  }
  return 0;
}
