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