#include <bits/stdc++.h>
using namespace std;
struct edge {
  long long to, cost;
};
const long long INF = 100000000000000000;
const long long INF2 = 9223372036854775807;
const long long MOD = 1000000007;
long long ceil2(long long a, long long b) {
  if (a % b == 0) {
    return a / b;
  } else {
    return a / b + 1;
  }
}
long long pow2(long long a, long long b) {
  long long r = 1;
  for (long long i = 1; i <= b; i++) {
    r *= a;
  }
  return r;
}
long long Log2(long long a) {
  long long t = 0;
  while (1) {
    if (a == 0 || a == 1) {
      break;
    }
    a /= 2;
    t++;
  }
  return t;
}
long long num[100010];
string S;
set<char> U;
signed main() {
  cin >> S;
  for (long long i = 0; i < (long long)(S.size()); i++) {
    num[S[i] - 'a']++;
    U.insert(S[i]);
  }
  if (U.size() == 1 || U.size() == 2) {
    cout << "NO" << endl;
    return 0;
  }
  cout << "YES" << endl;
  return 0;
}
