#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  string s;
  cin >> s;
  long long a[26];
  memset(a, 0, sizeof a);
  ;
  for (long long i = 0; i < s.size(); i++) {
    a[s[i] - 'a']++;
  }
  long long diff = 0;
  long long one = 0;
  for (long long i = 0; i < 26; i++) {
    if (a[i] != 0) {
      diff++;
      if (a[i] == 1) one++;
    }
  }
  if (diff > 4 || diff < 2)
    cout << "No";
  else if (diff == 2) {
    if (one >= 1)
      cout << "No";
    else
      cout << "Yes";
  } else if (diff == 3) {
    if (one == 3)
      cout << "No";
    else
      cout << "Yes";
  } else
    cout << "Yes";
  return 0;
}
long long choose(long long n, long long k) {
  if (k == 0) return 1;
  return (n * choose(n - 1, k - 1)) / k;
}
bool isprime(long long n) {
  for (long long i = 2; i * i <= n; i++) {
    if (n % i == 0) return false;
  }
  return true;
}
void setprime(bool isprime[], long long n) {
  for (long long i = 0; i < n; i++) isprime[i] = true;
  isprime[0] = false;
  isprime[1] = false;
  for (long long i = 2; i < n; i++) {
    for (long long j = 2; i * j < n; j++) isprime[i * j] = false;
  }
}
