#include <bits/stdc++.h>
using namespace std;
string s;
int v[300] = {0}, sum = 0, cnt = 0;
bool boo = false;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cin >> s;
  for (int i = 0; i < s.length(); i++) v[s[i]]++;
  for (int i = 'a'; i <= 'z'; i++) {
    if (v[i] > 0) ++cnt;
    if (v[i] == 1) boo = true;
    sum += v[i];
  }
  if (cnt > 4) {
    cout << "No\n";
    return 0;
  } else {
    if (cnt == 1) {
      cout << "No\n";
      return 0;
    } else if (cnt == 2) {
      if (boo) {
        cout << "No\n";
        return 0;
      }
    } else if (cnt == 3) {
      if (sum == 3) {
        cout << "No\n";
        return 0;
      }
    }
  }
  cout << "Yes\n";
}
