#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  string s;
  cin >> s;
  int arr[200] = {0};
  for (auto i : s) {
    arr[i]++;
  }
  int numdif = 0;
  for (int i = 'a'; i <= 'z'; i++) {
    if (arr[i] > 0) numdif++;
  }
  if (numdif == 1)
    cout << "No\n";
  else {
    if (numdif >= 5) cout << "No\n";
    if (numdif == 4) cout << "YES\n";
    if (numdif == 2) {
      int flag = 0;
      for (int i = 'a'; i <= 'z'; i++) {
        if (arr[i] > 0 && arr[i] < 2) {
          flag = 1;
        }
      }
      if (flag == 0)
        cout << "Yes\n";
      else {
        cout << "No\n";
      }
    }
    if (numdif == 3) {
      int flag = 0;
      for (int i = 'a'; i <= 'z'; i++) {
        if (arr[i] >= 2) flag = 1;
      }
      if (flag)
        cout << "Yes\n";
      else {
        cout << "No\n";
      }
    }
  }
}
