#pragma GCC optimize("O3") #pragma GCC optimize ("unroll-loops") #pragma GCC target ("avx") #define io_init cin.tie(0);ios::sync_with_stdio(0);cout< constexpr int INF = 2147483647; constexpr long long int INF_LL = 9223372036854775807; constexpr int MOD = 1000000007; constexpr double PI = 3.14159265358979323846; using namespace std; typedef long long int ll; typedef unsigned long long int ull; //abcde int main() { //io_init; string S; getline(cin, S); if (S.size() == 1) { cout << "NO" << endl; return 0; } else if (S.size() == 2) { if (S[0] == S[1]) { cout << "NO" << endl; } else { cout << "Yes" << endl; } return 0; } bool flag = false; for (int i = 0; i <= S.size() - 1; i++) { string tmp = S.substr(i, 2); if (tmp[0] == ' ')continue; set used; for (int j = 0; j < i; j++)if (S[j] != ' ')used.insert(S[j]); for (int j = i + 2; j < S.size(); j++)if (S[j] != ' ')used.insert(S[j]); if (!used.count(tmp[0]) && !used.count(tmp[0]))flag = true; } if (flag) { cout << "Yes" << endl; } else { cout << "NO" << endl; } return 0; }