#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
const int N = 1e6 + 10;
double EPS = 1e-12;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  ;
  string second;
  cin >> second;
  set<char> st;
  int arr[26] = {0};
  for (int i = 0; i < second.size(); i++) {
    st.insert(second[i]);
    arr[(int)(second[i] - 'a')]++;
  }
  if (st.size() == 1 || st.size() > 4) return cout << "No", 0;
  if (st.size() == 4) return cout << "Yes", 0;
  int c = 0;
  for (int i = 0; i < 26; i++) c += (arr[i] > 1);
  if (c >= 2 && st.size() == 2) return cout << "Yes", 0;
  if (c >= 1 && st.size() == 3) return cout << "Yes", 0;
  cout << "No";
  return 0;
}
