#include <bits/stdc++.h>
using namespace std;
map<char, int> mp;
int main() {
  string s;
  cin >> s;
  int cnt = 0;
  if (s.size() < 4) {
    cout << "no" << endl;
    return 0;
  }
  for (int i = 0; i < s.size(); i++) {
    if (mp[s[i]] == 0) {
      cnt++;
      mp[s[i]] = 1;
    }
  }
  if (cnt == 1) {
    cout << "no" << endl;
  }
  if (cnt == 4 || cnt == 3) {
    cout << "yes" << endl;
    return 0;
  }
  if (cnt > 4) {
    cout << "no" << endl;
  }
  if (cnt == 2) {
    int flag = 0;
    for (int i = 0; i < s.size(); i++) {
      if (s[i] == s[0]) {
        flag++;
      }
    }
    if (flag == 1 || s.size() - flag == 1) {
      cout << "no" << endl;
      return 0;
    } else {
      cout << "yes" << endl;
      return 0;
    }
  }
}
