#include <bits/stdc++.h>
using namespace std;
void fast() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
}
int main() {
  string s;
  cin >> s;
  set<char> s1;
  int arr[150];
  for (int i = 0; i < 128; i++) {
    arr[i] = 0;
  }
  for (int i = 0; i < s.size(); i++) {
    s1.insert(s[i]);
    int temp = s[i];
    arr[temp]++;
  }
  int e = 0, o = 0;
  for (int i = 96; i < 128; i++) {
    if (arr[i] >= 2) {
      e++;
    } else if (arr[i] == 1) {
      o++;
    }
  }
  if (s1.size() > 4) {
    cout << "No" << endl;
  } else if (s1.size() == 2) {
    if (e > 1) {
      cout << "Yes" << endl;
    } else {
      cout << "No" << endl;
    }
  } else if (s1.size() == 3) {
    if (o == 3) {
      cout << "No" << endl;
    } else {
      cout << "Yes" << endl;
    }
  } else if (s1.size() == 4) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
}
