#include <bits/stdc++.h>

using namespace std;

#define f first
#define s second
#define pb push_back
#define mp make_pair
#define all(v) v.begin(), v.end()
#define sz(v) (int)v.size()

#define MOO(i, a, b) for(int i=a; i<b; i++)
#define M00(i, a) for(int i=0; i<a; i++)
#define MOOd(i,a,b) for(int i = (b)-1; i >= a; i--)
#define M00d(i,a) for(int i = (a)-1; i>=0; i--)

#define FAST ios::sync_with_stdio(0); cin.tie(0);
#define finish(x) return cout << x << '\n', 0;
#define dbg(x) cerr << ">>> " << #x << " = " << x << "\n";
#define _ << " _ " <<

typedef long long ll;
typedef long double ld;
typedef vector<int> vi;
typedef pair<int,int> pi;
typedef pair<ld,ld> pd;
typedef complex<ld> cd;

struct node {
    ll val;
    int l, r;
    node* left;
    node* right;
    node(int l, int r) {
        this -> val = 0;
        this -> l = l;
        this -> r = r;
        this -> left = nullptr;
        this -> right = nullptr;
    }
};

template<int SZ> struct sumtree{
    node* root;
    sumtree() {
        int ub = 1;
        while(ub < SZ) ub *= 2;
        root = new node(0, ub-1);
    }
    void updN(node* n, int pos, ll val) {
        if(pos < n->l || pos > n->r) return;
        if(n->l == n->r) {
            n->val += val;
            return;
        }

        int mid = (n->l + n->r)/2;
        if(pos > mid) {
            if(n->right == nullptr) n->right = new node(mid+1, n->r);
            updN(n->right, pos, val);
        }
        else {
            if(n->left == nullptr) n->left = new node(n->l, mid);
            updN(n->left, pos, val);
        }

        ll s = 0;
        if(n->right != nullptr) s += n->right->val;
        if(n->left != nullptr) s += n->left->val;

        n->val = s;
    }
    void upd(int pos, ll val) {
        updN(root, pos, val);
    }
    ll queryN(node* n, int i1, int i2) {
        if(i2 < n->l || i1 > n->r) return 0;
        if(n->l == n->r) return n->val;
        if(n->l >= i1 && n->r <= i2) return n->val;

        ll s = 0;
        if(n->left != nullptr) s += queryN(n->left, i1, i2);
        if(n->right != nullptr) s += queryN(n->right, i1, i2);

        return s;
    }
    ll query(int i1, int i2) {
        return queryN(root, i1, i2);
    }
};

const int MAX_N = 200200;
int n, m, p;
pair<ll,ll> att[MAX_N]; // cost, atk
pair<ll,ll> def[MAX_N]; // cost, def
pair<pair<ll,ll>, ll> mons[MAX_N]; // atk, def, cost
bool attValid[MAX_N];
bool defValid[MAX_N];

int main() { FAST
	cin >> n >> m >> p;
	M00(i, n) cin >> att[i].s >> att[i].f;
	sort(att,att+n);
	int curmax = 0;
	M00(i, n) {
		if(att[i].s <= curmax) {
			attValid[i] = false;
		} else {
			attValid[i] = true;
			curmax = att[i].s;
		}
	}
	M00(i, m) cin >> def[i].s >> def[i].f;
	sort(def, def+m);
	curmax = 0;
	M00(i, m) {
		if(def[i].s <= curmax) {
			defValid[i] = false;
		} else {
			defValid[i] = true;
			curmax = def[i].s;
		}
	}

	M00(i, p) cin >> mons[i].f.s >> mons[i].f.f >> mons[i].s;
	vector<pair<ll,ll>> validAttacks; // atk, cost
	vector<pair<ll,ll>> validDefenses; // def, cost
	M00(i, n) if(attValid[i]) validAttacks.pb(mp(att[i].s, att[i].f));
	M00(i, m) if(defValid[i]) validDefenses.pb(mp(def[i].s, def[i].f));

	sumtree<2000000> st;
	sort(mons, mons+p);
	set<int> seenAtt;
	ll res = -1e18;
	M00(i, p) {
		ll curAtt = mons[i].f.f;
		if(!seenAtt.count(curAtt)) {
			seenAtt.insert(curAtt);
			for(int j = i; j < p; j++) {
				if(mons[j].f.f == curAtt) {
					st.upd(mons[j].f.s, mons[j].s);
				} else {
					break;
				}
			}
		}
		ll curDef = mons[i].f.s;
		ll profit = 0;
		auto it1 = lower_bound(all(validDefenses), mp(curAtt,-1LL));
		auto it2 = lower_bound(all(validAttacks), mp(curDef,-1LL));
		if(it1 == validDefenses.end() || it2 == validAttacks.end()) continue;
		profit -= (*it1).s;
		profit -= (*it2).s;
		profit += st.query(0, curDef);
		res = max(res, profit);
	}
	finish(res);
}


#include <bits/stdc++.h>

using namespace std;

const int MAXN = 8*65536;

const int INF = 2147483647;

int dodo[MAXN], push[MAXN];

void pls_ravno(int l, int r, int add, int lb = 0, int rb = MAXN>>1, int v = 1) {
    if (l <= lb && rb <= r) {
        push[v] += add;
        return;
    }
    if (l >= rb || r <= lb) {
        return;
    }
    pls_ravno(l, r, add, lb, (lb + rb) >> 1, v + v);
    pls_ravno(l, r, add, (lb + rb) >> 1, rb, v + v + 1);
    dodo[v] = max(dodo[v + v] + push[v + v], dodo[v + v + 1] + push[v + v + 1]);
}

signed main() {
    for (int i = 0; i < MAXN; ++i) {
        dodo[i] = -INF;
        push[i] = 0;
    }
    int n, m, p;
    cin >> n >> m >> p;
    vector<pair<int, int>> a(n), b(m);
    map<int, int> xx, yy;
    vector<pair<pair<int, int>, int>> c(p);
    for (int i = 0; i < n; ++i) {
        cin >> a[i].first >> a[i].second;
        xx[a[i].first] = 2;
    }
    for (int i = 0; i < m; ++i) {
        cin >> b[i].first >> b[i].second;
        yy[b[i].first] = 2;
    }
    for (int i = 0; i < p; ++i) {
        cin >> c[i].first.first >> c[i].first.second >> c[i].second;
        xx[c[i].first.first] = 2;
        yy[c[i].first.second] = 2;
    }
    int timer = 0;
    for (auto x : xx) {
        xx[x.first] = timer++;
    }
    timer = 0;
    for (auto x : yy) {
        yy[x.first] = timer++;
    }
    for (int i = 0; i < n; ++i) {
        a[i].first = xx[a[i].first];
    }
    for (int i = 0; i < m; ++i) {
        b[i].first = yy[b[i].first];
    }
    for (int i = 0; i < p; ++i) {
        c[i].first.first = xx[c[i].first.first];
        c[i].first.second = yy[c[i].first.second];
    }
    vector<pair<int, int>> A;
    sort(a.begin(), a.end());
    for (auto x : a) {
        while (A.size() != 0 && A.back().second > x.second)
            A.pop_back();
        if (A.size() == 0 || A.back().first != x.first)
            A.push_back(x);
    }
    a.clear();
    a.shrink_to_fit();
    vector<pair<int, int>> B;
    sort(b.begin(), b.end());
    for (auto x : b) {
        while (B.size() != 0 && B.back().second > x.second)
            B.pop_back();
        if (B.size() == 0 || B.back().first != x.first)
            B.push_back(x);
    }
    b.clear();
    b.shrink_to_fit();
    int ans = -(A[0].second + B[0].second);
    int uk = B.back().first - 1;
    for (int i = B.size() - 1; i > 0; --i) {
        while (uk >= 0 && uk >= B[i - 1].first)
            dodo[uk-- + (MAXN>>1)] = -B[i].second;
    }
    while (uk >= 0)
        dodo[uk-- + (MAXN>>1)] = -B[0].second;
    uk += (MAXN>>1);
    while (uk > 0) {
        dodo[uk] = max(dodo[uk + uk], dodo[uk + uk + 1]);
        --uk;
    }
    sort(c.begin(), c.end());
    for (auto x : c) {
        pls_ravno(x.first.second, MAXN>>1, x.second);
        auto it = upper_bound(A.begin(), A.end(), make_pair(x.first.first, INF));
        if (it != A.end()) {
            ans = max(ans, -(*it).second + dodo[1] + push[1]);
        }
    }
    cout << ans << '\n';
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

const int MAXN = 32*65536;

const int INF = 2147483647;

int dodo[MAXN], push[MAXN];

void pls_ravno(int l, int r, int add, int lb = 0, int rb = MAXN>>1, int v = 1) {
    if (l <= lb && rb <= r) {
        push[v] += add;
        return;
    }
    if (l >= rb || r <= lb) {
        return;
    }
    pls_ravno(l, r, add, lb, (lb + rb) >> 1, v + v);
    pls_ravno(l, r, add, (lb + rb) >> 1, rb, v + v + 1);
    dodo[v] = max(dodo[v + v] + push[v + v], dodo[v + v + 1] + push[v + v + 1]);
}

signed main() {
    cin.tie(nullptr);
    cout.tie(nullptr);
    ios_base::sync_with_stdio(false);
    for (int i = 0; i < MAXN; ++i) {
        dodo[i] = -INF;
        push[i] = 0;
    }
    int n, m, p;
    cin >> n >> m >> p;
    vector<pair<int, int>> a(n), b(m);
    vector<pair<pair<int, int>, int>> c(p);
    for (int i = 0; i < n; ++i) {
        cin >> a[i].first >> a[i].second;
    }
    for (int i = 0; i < m; ++i) {
        cin >> b[i].first >> b[i].second;
    }
    for (int i = 0; i < p; ++i) {
        cin >> c[i].first.first >> c[i].first.second >> c[i].second;
    }
    vector<pair<int, int>> A;
    A.reserve(n);
    sort(a.begin(), a.end());
    for (auto x : a) {
        while (A.size() != 0 && A.back().second > x.second)
            A.pop_back();
        if (A.size() == 0 || A.back().first != x.first)
            A.push_back(x);
    }
    vector<pair<int, int>> B;
    B.reserve(m);
    sort(b.begin(), b.end());
    for (auto x : b) {
        while (B.size() != 0 && B.back().second > x.second)
            B.pop_back();
        if (B.size() == 0 || B.back().first != x.first)
            B.push_back(x);
    }
    int ans = -(A[0].second + B[0].second);
    int uk = B.back().first - 1;
    for (int i = B.size() - 1; i > 0; --i) {
        while (uk >= 0 && uk >= B[i - 1].first)
            dodo[uk-- + (MAXN>>1)] = -B[i].second;
    }
    while (uk >= 0)
        dodo[uk-- + (MAXN>>1)] = -B[0].second;
    uk += (MAXN>>1);
    while (uk > 0) {
        dodo[uk] = max(dodo[uk + uk], dodo[uk + uk + 1]);
        --uk;
    }
    sort(c.begin(), c.end());
    for (auto x : c) {
        pls_ravno(x.first.second, MAXN>>1, x.second);
        auto it = upper_bound(A.begin(), A.end(), make_pair(x.first.first, INF));
        if (it != A.end()) {
            ans = max(ans, -(*it).second + dodo[1] + push[1]);
        }
    }
    cout << ans << '\n';
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

const int MAXN = 65536 * 16;

const long long INF = 1e18;

long long dodo[MAXN], push[MAXN];

void pls_ravno(int l, int r, long long add, int lb = 0, int rb = MAXN>>1, int v = 1) {
    if (l <= lb && rb <= r) {
        push[v] += add;
        return;
    }
    if (rb >= l || lb <= r) {
        return;
    }
    pls_ravno(l, r, add, lb, (lb + rb) >> 1, v + v);
    pls_ravno(l, r, add, (lb + rb) >> 1, rb, v + v + 1);
    dodo[v] = max(dodo[v + v] + push[v + v], dodo[v + v + 1] + push[v + v + 1]);
}

signed main() {
    for (int i = 0; i < MAXN; ++i) {
        dodo[i] = -INF;
        push[i] = 0;
    }
    int n, m, p;
    cin >> n >> m >> p;
    vector<pair<int, int>> a(n), b(m);
    map<int, int> xx, yy;
    vector<pair<pair<int, int>, int>> c(p);
    for (int i = 0; i < n; ++i) {
        cin >> a[i].first >> a[i].second;
        xx[a[i].first] = 2;
    }
    for (int i = 0; i < m; ++i) {
        cin >> b[i].first >> b[i].second;
        yy[b[i].first] = 2;
    }
    for (int i = 0; i < p; ++i) {
        cin >> c[i].first.first >> c[i].first.second >> c[i].second;
        xx[c[i].first.first] = 2;
        yy[c[i].first.second] = 2;
    }
    int timer = 0;
    for (auto x : xx)
        xx[x.first] = timer++;
    timer = 0;
    for (auto x : yy)
        yy[x.first] = timer++;
    for (int i = 0; i < n; ++i)
        a[i].first = xx[a[i].first];
    for (int i = 0; i < m; ++i)
        b[i].first = yy[b[i].first];
    for (int i = 0; i < p; ++i) {
        c[i].first.first = xx[c[i].first.first];
        c[i].first.second = yy[c[i].first.second];
    }
    vector<pair<int, int>> A;
    sort(a.begin(), a.end());
    for (auto x : a) {
        while (A.size() != 0 && A.back().second > x.second)
            A.pop_back();
        A.push_back(x);
    }
    a.clear();
    a.shrink_to_fit();
    vector<pair<int, int>> B;
    sort(b.begin(), b.end());
    for (auto x : b) {
        while (B.size() != 0 && B.back().second > x.second)
            B.pop_back();
        B.push_back(x);
    }
    b.clear();
    b.shrink_to_fit();
    long long ans = -(A[0].second + B[0].second);
    int uk = B.back().first;
    for (int i = B.size() - 1; i > 0; --i) {
        while (uk >= 0 && uk > B[i - 1].first)
            dodo[uk-- + (MAXN>>1)] = -B[i].second;
    }
    while (uk >= 0)
        dodo[uk-- + (MAXN>>1)] = -B[0].second;
    uk += (MAXN>>1);
    while (uk > 0) {
        dodo[uk] = max(dodo[uk + uk], dodo[uk + uk + 1]);
        --uk;
    }
    vector<pair<pair<long long, long long>, long long>> events;
    for (auto x : A) {
        events.push_back({{x.first, -INF}, x.second});
    }
    for (auto x : c) {
        events.push_back({{x.first.first, x.first.second}, x.second});
    }
    sort(events.begin(), events.end());
    long long now = -INF;
    for (auto x : events) {
        if (x.first.second == -INF)  {
            now = -x.second;
            continue;
        }
        pls_ravno(x.first.second, MAXN>>1, x.second);
        ans = max(ans, now + dodo[1] + push[1]);
    }
    cout << ans << '\n';
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

const int MAXN = 65536 * 16;

const long long INF = 1e18;

long long dodo[MAXN], push[MAXN];

void pls_ravno(int l, int r, long long add, int lb = 0, int rb = MAXN>>1, int v = 1) {
    if (l <= lb && rb <= r) {
        push[v] += add;
        return;
    }
    if (rb >= l || lb <= r) {
        return;
    }
    pls_ravno(l, r, add, lb, (lb + rb) >> 1, v + v);
    pls_ravno(l, r, add, (lb + rb) >> 1, rb, v + v + 1);
    dodo[v] = max(dodo[v + v] + push[v + v], dodo[v + v + 1] + push[v + v + 1]);
}

signed main() {
    for (int i = 0; i < MAXN; ++i) {
        dodo[i] = -INF;
        push[i] = 0;
    }
    int n, m, p;
    cin >> n >> m >> p;
    vector<pair<int, int>> a(n), b(m);
    map<int, int> xx, yy;
    vector<pair<pair<int, int>, int>> c(p);
    for (int i = 0; i < n; ++i) {
        cin >> a[i].first >> a[i].second;
        xx[a[i].first] = 2;
    }
    for (int i = 0; i < m; ++i) {
        cin >> b[i].first >> b[i].second;
        yy[b[i].first] = 2;
    }
    for (int i = 0; i < p; ++i) {
        cin >> c[i].first.first >> c[i].first.second >> c[i].second;
        xx[c[i].first.first] = 2;
        yy[c[i].first.second] = 2;
    }
    int timer = 0;
    for (auto x : xx)
        xx[x.first] = timer++;
    timer = 0;
    for (auto x : yy)
        yy[x.first] = timer++;
    for (int i = 0; i < n; ++i)
        a[i].first = xx[a[i].first];
    for (int i = 0; i < m; ++i)
        b[i].first = yy[b[i].first];
    for (int i = 0; i < p; ++i) {
        c[i].first.first = xx[c[i].first.first];
        c[i].first.second = yy[c[i].first.second];
    }
    vector<pair<int, int>> A;
    sort(a.begin(), a.end());
    for (auto x : a) {
        while (A.size() != 0 && A.back().second > x.second)
            A.pop_back();
        A.push_back(x);
    }
    a.clear();
    a.shrink_to_fit();
    vector<pair<int, int>> B;
    sort(b.begin(), b.end());
    for (auto x : b) {
        while (B.size() != 0 && B.back().second > x.second)
            B.pop_back();
        B.push_back(x);
    }
    b.clear();
    b.shrink_to_fit();
    long long ans = -(A[0].second + B[0].second);
    int uk = B.back().first;
    for (int i = B.size() - 1; i > 0; --i) {
        while (uk >= 0 && uk > B[i - 1].first)
            dodo[uk-- + (MAXN>>1)] = -B[i].second;
    }
    while (uk >= 0)
        dodo[uk-- + (MAXN>>1)] = -B[0].second;
    uk += (MAXN>>1);
    while (uk > 0) {
        dodo[uk] = max(dodo[uk + uk], dodo[uk + uk + 1]);
        --uk;
    }
    vector<pair<pair<long long, long long>, long long>> events;
    for (auto x : A) {
        events.push_back({{x.first, INF}, x.second});
    }
    for (auto x : c) {
        events.push_back({{x.first.first, x.first.second}, x.second});
    }
    sort(events.rbegin(), events.rend());
    long long now = -INF;
    for (auto x : events) {
        if (x.first.second == INF)  {
            now = -x.second;
            continue;
        }
        pls_ravno(x.first.second, MAXN>>1, x.second);
        ans = max(ans, now + dodo[1] + push[1]);
    }
    cout << ans << '\n';
    return 0;
}


#include <cstdio>
#include <map>
#include <cstring>
using namespace std;
char s[100005];
int main()
{
    while(scanf("%s",s) != EOF){
        map<char,int>cnt;
        int k = 0,t = 0;
        for(int i = 0; i < strlen(s);++i){
            if(cnt[s[i]]== 0)++k;
            cnt[s[i]]++;
            if(cnt[s[i]] == 2)++t;
            if(k >= 2 && t >= 2){
                printf("Yes\n");
                return 0;
            }
        }
        printf("No\n");
    }
    return 0;
}


#include <cstdio>
#include <cstring>
using namespace std;
char s[100002];
int main()
{
    while(scanf("%s",s) != EOF){
        int cnt[27] = {0},k = 0,t = 0,c=0;
        bool flag = false;
        for(int i = 0; s[i];++i){
            if(++cnt[s[i]-'a'] == 1)++k;
            if(k > 4){
                flag = false;break;
            }
            if(cnt[s[i]-'a'] == 2)++c;
            //if(cnt[s[i]-'a'] == 1)++t;
            if((c == 1 && k > 2)||(c > 1 && k > 1)||k == 4){
                flag = true;
            }
        }
        printf("%s\n",flag ? "Yes":"No");
    }
  return 0;
}


#include <algorithm>
#include <iostream>
#include <string>
#include <cstring>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <iomanip>
#include <math.h>
using namespace std;

int main() {
	string s;
	cin >> s;
	int n = s.size();
	int c = 0;
	map <char, int> mp;
	for (int i = 0; i < n; i++){
		if (s[i] != s[i + 1] && i != n - 1){ c++; }
		if (mp.size()>2){ cout << "No";
		return 0;
		}
		else{
			mp[s[i]]++;
		}
	}
	if (mp.size() == 2 && c!=1){ cout << "Yes"; }
	else{ cout << "No"; }
	return 0;
}


#include <algorithm>
#include <iostream>
#include <string>
#include <cstring>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <iomanip>
#include <math.h>
using namespace std;

int main() {
	string s;
	cin >> s;
	int n = s.size();
	int c = 0;
	map <char, int> mp;
	for (int i = 0; i < n; i++){
		if (s[i] != s[i + 1] && i != n - 1){ c++; }
		if (mp.size()>2){ cout << "No";
		break;
		}
		else{
			mp[s[i]]++;
		}
	}
	if (mp.size() == 2 && c!=1){ cout << "Yes"; }
	else{ cout << "No"; }
	return 0;
}


#include <algorithm>
#include <iostream>
#include <string>
#include <cstring>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <iomanip>
#include <math.h>
using namespace std;

int main() {
	string s;
	cin >> s;
	int n = s.size();
	int c = 0;
	map <char, int> mp;
	for (int i = 0; i < n; i++){
		if (s[i] != s[i + 1] && i != n - 1){ c++; }
		if (mp.size()>2){ cout << "No";
		break;
		}
		else{
			mp[s[i]]++;
		}
	}
	if (mp.size() == 2 && c==2){ cout << "Yes"; }
	else{ cout << "No"; }
	return 0;
}


#include <algorithm>
#include <iostream>
#include <string>
#include <cstring>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <iomanip>
#include <math.h>
using namespace std;

int main() {
	string s;
	cin >> s;
	int n = s.size();
	map<char, int> mp;
	for (int i = 0; i < n; i++){
		mp[s[i]]++;
	}
	int m = mp.size();
	if (m == 4){ cout << "YES"; }
	else if (m == 3 && n>3){
		map<char, int> ::iterator it;
		it = mp.begin();
		int x = it->second;
		it++;
		int y = it->second;
		it++;
		int z = it->second;
		if (x >= 2 && y >= 2 && z >= 2){ cout << "YES"; }
		else{ cout << "NO"; }
	}
	else if (m == 2){
		map<char, int> ::iterator it;
		it = mp.begin();
		int x = it->second;
		it++;
		int y = it->second;
		if (x >= 2 && y >= 2){ cout << "YES"; }
		else{ cout << "NO"; }
	}
	else{ cout << "NO"; }
	return 0;
}


#include <algorithm>
#include <iostream>
#include <string>
#include <cstring>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <iomanip>
#include <math.h>
using namespace std;

int main() {
	string s;
	cin >> s;
	int n = s.size();
	map<char, int> mp;
	for (int i = 0; i < n; i++){
		mp[s[i]]++;
	}
	int m = mp.size();
	if (m == 4){ cout << "YES"; }
	else if (m == 3 && n>3){ cout << "YES"; }
	else if (m == 2){
		map<char, int> ::iterator it;
		it = mp.begin();
		int x = it->second;
		it++;
		int y = it->second;
		if (x >= 2 && y >= 2){ cout << "YES"; }
		else{ cout << "NO"; }
	}
	else{ cout << "NO"; }
	return 0;
}


#pragma GCC optimize("O3")
#include <bits/stdc++.h>
#define MOD 1000000007
using namespace std;
typedef long long ll;
typedef pair< int , int > PII;

string s;
int f[500], rs, cnt;

int main(){
    //ifstream cin("date.in");
    //ofstream cout("date.out");
    ios_base::sync_with_stdio(0);
    cin.tie(0); cout.tie(0);
    cin >> s;
    for (auto it : s) f[it]++;

    for (char i = 'a'; i <= 'z'; i++){
        rs += f[i] > 0;
        cnt += f[i] > 1;
    }

    //cout << rs << " " << cnt << "\n";

    if ((cnt > 1 || rs == 4 || (rs == 3 && cnt > 0))) return cout << "Yes", 0;

    cout << "No";

	return 0;
}


#pragma GCC optimize("O3")
#include <bits/stdc++.h>
#define MOD 1000000007
using namespace std;
typedef long long ll;
typedef pair< int , int > PII;

string s;
int f[500], rs, cnt;

int main(){
    ifstream cin("date.in");
    ofstream cout("date.out");
    ios_base::sync_with_stdio(0);
    cin.tie(0); cout.tie(0);
    cin >> s;
    for (auto it : s) f[it]++;

    for (char i = 'a'; i <= 'z'; i++){
        rs += f[i] > 0;
        cnt += f[i] > 1;
    }

    //cout << rs << " " << cnt << "\n";

    if (cnt > 1 || rs > 3 || (rs == 3 && cnt > 0)) return cout << "Yes", 0;

    cout << "No";

	return 0;
}


#pragma GCC optimize("O3")
#include <bits/stdc++.h>
#define MOD 1000000007
using namespace std;
typedef long long ll;
typedef pair< int , int > PII;

string s;
int f[500], rs, cnt;

int main(){
    //ifstream cin("date.in");
    //ofstream cout("date.out");
    ios_base::sync_with_stdio(0);
    cin.tie(0); cout.tie(0);
    cin >> s;
    for (auto it : s) f[it]++;

    for (char i = 'a'; i <= 'z'; i++){
        rs += f[i] > 0;
        cnt += f[i] > 1;
    }

    //cout << rs << " " << cnt << "\n";

    if ((cnt > 1 || rs == 4 || (rs == 3 && cnt > 0)) && rs <= 4) return cout << "Yes", 0;

    cout << "No";

	return 0;
}


#pragma GCC optimize("O3")
#include <bits/stdc++.h>
#define MOD 1000000007
using namespace std;
typedef long long ll;
typedef pair< int , int > PII;

string s;
int f[500], rs, cnt;

int main(){
    //ifstream cin("date.in");
    //ofstream cout("date.out");
    ios_base::sync_with_stdio(0);
    cin.tie(0); cout.tie(0);
    cin >> s;
    for (auto it : s) f[it]++;

    for (char i = 'a'; i <= 'z'; i++){
        rs += f[i] > 0;
        cnt += f[i] > 1;
    }

    //cout << rs << " " << cnt << "\n";

    if (cnt > 1 || rs > 3 || (rs == 3 && cnt > 0)) return cout << "Yes", 0;

    cout << "No";

	return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define FastIO ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define sz(a) int((a).size())
#define sza(a) (int)(sizeof(a)/sizeof((a)[0]))
#define all(c) (c).begin(),(c).end()
#define clr(x,y) memset(x,(y),sizeof x)
#define ft first
#define sd second
#define ri reverse_iterator
#define pb push_back
typedef vector<int> vi;
typedef long long ll;
typedef pair<int, int> ii;
typedef vector<ii> vii;
#define rep(i,a,n) for (int i=(a);i<(n);i++)
typedef unsigned long ul;
const int oo = (int) 10e5 + 1;
int t[3];
map<char, int> z;
void solution() {
	string x;
	cin >> x;
	rep(i,0,sz(x))
		z[x[i]]++;
	vi t;
	for (auto it : z)
		t.pb(it.sd);
	sort(all(t));
	if (sz(t) >= 5)
		cout << "No";
	else if (sz(t) == 4)
		cout << "Yes";
	else if (sz(t) == 3)
		cout << (t.back() >= 2 ? "Yes" : "No");
	else if (sz(t) == 2)
		cout << (t[0] == 1 and t[1] >= 2 ? "Yes" : "No");
	else
		cout << "No";
}
int main() {
	FastIO;
	solution();
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define FastIO ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define sz(a) int((a).size())
#define sza(a) (int)(sizeof(a)/sizeof((a)[0]))
#define all(c) (c).begin(),(c).end()
#define clr(x,y) memset(x,(y),sizeof x)
#define ft first
#define sd second
#define ri reverse_iterator
#define pb push_back
typedef vector<int> vi;
typedef long long ll;
typedef pair<int, int> ii;
typedef vector<ii> vii;
#define rep(i,a,n) for (int i=(a);i<(n);i++)
typedef unsigned long ul;
const int oo = (int) 10e5 + 1;
int t[3];
map<char, int> z;
void solution() {
	string x;
	cin >> x;
	rep(i,0,sz(x))
		z[x[i]]++;
	vi t;
	for (auto it : z)
		t.pb(it.sd);
	sort(all(t));
	if (sz(t) >= 5)
		cout << "No";
	else if (sz(t) == 4)
		cout << "Yes";
	else if (sz(t) == 3)
		cout << (t.back() >= 2 ? "Yes" : "No");
	else if (sz(t) == 2)
		cout << (t[0] == 1 and t[2] >= 2 ? "Yes" : "No");
	else
		cout << "No";
}
int main() {
	FastIO;
	solution();
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define FastIO ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define sz(a) int((a).size())
#define sza(a) (int)(sizeof(a)/sizeof((a)[0]))
#define all(c) (c).begin(),(c).end()
#define clr(x,y) memset(x,(y),sizeof x)
#define ft first
#define sd second
#define ri reverse_iterator
#define pb push_back
typedef vector<int> vi;
typedef long long ll;
typedef pair<int, int> ii;
typedef vector<ii> vii;
#define rep(i,a,n) for (int i=(a);i<(n);i++)
typedef unsigned long ul;
const int oo = (int) 10e5 + 1;
int t[3];
map<char, int> z;
void solution() {
	string x;
	cin >> x;
	rep(i,0,sz(x))
		z[x[i]]++;
	vi t;
	for (auto it : z)
		t.pb(it.sd);
	sort(all(t));
	if (sz(t) >= 5)
		cout << "No";
	else if (sz(t) == 4)
		cout << "Yes";
	else if (sz(t) == 3)
		cout << (t.back() >= 2 ? "Yes" : "No");
	else if (sz(t) == 2)
		cout << (t[0] >= 2 and t[1] >= 2 ? "Yes" : "No");
	else
		cout << "No";
}
int main() {
	FastIO;
	solution();
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define FastIO ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define sz(a) int((a).size())
#define sza(a) (int)(sizeof(a)/sizeof((a)[0]))
#define all(c) (c).begin(),(c).end()
#define clr(x,y) memset(x,(y),sizeof x)
#define ft first
#define sd second
#define ri reverse_iterator
#define pb push_back
typedef vector<int> vi;
typedef long long ll;
typedef pair<int, int> ii;
typedef vector<ii> vii;
#define rep(i,a,n) for (int i=(a);i<(n);i++)
typedef unsigned long ul;
const int oo = (int) 10e5 + 1;
int t[3];
map<char, int> z;
void solution() {
	string x;
	cin >> x;
	rep(i,0,sz(x))
		z[x[i]]++;
	vi t;
	for (auto it : z)
		t.pb(it.sd);
	sort(all(t));
	if (sz(t) >= 5)
		cout << "No";
	else if (sz(t) == 4)
		cout << "Yes";
	else if (sz(t) == 3)
		cout << (t.back() >= 2 ? "Yes" : "No");
	else if (sz(t) == 2)
		cout << (t[0] >= 1 and t[1] >= 2 ? "Yes" : "No");
	else
		cout << "No";
}
int main() {
	FastIO;
	solution();
	return 0;
}


#include <iostream>
#include <cstdio>
#include <cstring>
using namespace std;
int main(){
    string str;
    cin>>str;
    int cnt[26];
    memset(cnt,0,sizeof(cnt));
    int stylenum=0;
    for(int i=0;i<str.length();i++)
    {

        if(cnt[str[i]-'a']==0)
            stylenum++;
        cnt[str[i]-'a']++;
    }

    if(stylenum<2 || stylenum>4)
        printf("No\n");
    else if(stylenum==2)
    {
        int flag=0;
        for(int i=0;i<26;i++)
        {
            if(cnt[i]==1)
            {
                flag=1;
                printf("No\n");
            }
        }
        if(flag==0)
            printf("Yes\n");
    }
    else if(stylenum==3)
    {
        if(str.length()==3)
            printf("No\n");
        else
            printf("Yes\n");
    }
    else
        printf("Yes\n");
}


#include <iostream>
#include <cstdio>
using namespace std;
int main(){
    string str;
    cin>>str;
    int cnt[26];
    memset(cnt,0,sizeof(cnt));
    int stylenum=0;
    for(int i=0;i<str.length();i++)
    {

        if(cnt[str[i]-'a']==0)
            stylenum++;
        cnt[str[i]-'a']++;
    }

    if(stylenum<2 || stylenum>4)
        printf("No\n");
    else if(stylenum==2)
    {
        int flag=0;
        for(int i=0;i<26;i++)
        {
            if(cnt[i]==1)
            {
                flag=1;
                printf("No\n");
            }
        }
        if(flag==0)
            printf("Yes\n");
    }
    else if(stylenum==3)
    {
        if(str.length()==3)
            printf("No\n");
        else
            printf("Yes\n");
    }
    else
        printf("Yes\n");
}


#include <iostream>
#include <cstdio>
#include <cstring>
using namespace std;
int main(){
    string str;
    cin>>str;
    int cnt[26];
    memset(cnt,0,sizeof(cnt));
    int stylenum=0;
    for(int i=0;i<str.length();i++)
    {

        if(cnt[str[i]-'a']==0)
            stylenum++;
        cnt[str[i]-'a']++;
    }

    if(stylenum<2 || stylenum>4)
        printf("No\n");
    else if(stylenum==2)
    {
        int flag=0;
        for(int i=0;i<26;i++)
        {
            if(cnt[i]==1)
            {
                flag=1;
                printf("No\n");
                break;
            }
        }
        if(flag==0)
            printf("Yes\n");
    }
    else if(stylenum==3)
    {
        if(str.length()==3)
            printf("No\n");
        else
            printf("Yes\n");
    }
    else
        printf("Yes\n");
}


#include <bits/stdc++.h>
using namespace std;
int arr[26],a=0,b=0;
string s;
int main(){
	cin>>s;
	for(int i=0;i<26;i++)arr[i]=0;
	for(int i=0;i<s.size();i++){
		arr[s[i]-97]++;
	}
	for(int i=0;i<26;i++){
		//cout<<arr[i]<<endl;
		if(arr[i]>0){
			if(arr[i]>1){
				a++;//cout<<"C";
			}else{
				b++;//cout<<"B";
			}
		}
	}
	if(a>1){
		cout<<"Yes";
	}else if(a==1){
		if(b>1){
			cout<<"Yes";
		}else{
			cout<<"No";
		}
	}else{
		if(b>4){
			cout<<"Yes";
		}else{
			cout<<"No";
		}
	}
}


#include <bits/stdc++.h>
using namespace std;
int arr[26],a=0,b=0;
string s;
int main(){
	cin>>s;
	for(int i=0;i<26;i++)arr[i]=0;
	for(int i=0;i<s.size();i++){
		arr[s[i]-97]++;
	}
	for(int i=0;i<26;i++){
		//cout<<arr[i]<<endl;
		if(arr[i]>0){
			if(arr[i]>1){
				a++;//cout<<"C";
			}else{
				b++;//cout<<"B";
			}
		}
	}
	if(a+b==2){
		if(a==2){
			cout<<"Yes";
		}else{
			cout<<"No";
		}
	}else{
		if(a+b==3 || a+b==4){
			cout<<"Yes";
		}else{
			cout<<"No";
		}
	}

}


#include <bits/stdc++.h>
using namespace std;
int arr[26],a=0,b=0;
string s;
int main(){
	cin>>s;
	for(int i=0;i<26;i++)arr[i]=0;
	for(int i=0;i<s.size();i++){
		arr[s[i]-97]++;
	}
	for(int i=0;i<26;i++){
		//cout<<arr[i]<<endl;
		if(arr[i]>0){
			if(arr[i]>1){
				a++;//cout<<"C";
			}else{
				b++;//cout<<"B";
			}
		}
	}
	if(a>1){
		cout<<"Yes";
	}else if(a==1){
		if(b>1){
			cout<<"Yes";
		}else{
			cout<<"No";
		}
	}else{
		if(b>=4){
			cout<<"Yes";
		}else{
			cout<<"No";
		}
	}
}


#include <bits/stdc++.h>
using namespace std;
int arr[26],a=0,b=0;
string s;
int main(){
	cin>>s;
	for(int i=0;i<26;i++)arr[i]=0;
	for(int i=0;i<s.size();i++){
		arr[s[i]-97]++;
	}
	for(int i=0;i<26;i++){
		//cout<<arr[i]<<endl;
		if(arr[i]>0){
			if(arr[i]>1){
				a++;//cout<<"C";
			}else{
				b++;//cout<<"B";
			}
		}
	}
	if(a+b==2){
		if(a==2){
			cout<<"Yes";
			return 0;
		}else{
			cout<<"No";
			return 0;
		}
	}else{
		if(a+b==3){
			if(a>0) cout<<"Yes";
			else cout<<"No";
			return 0;
		}
		if(a+b==4){
			cout<<"Yes";
			return 0;
		}
		cout<<"No";
		return 0;
	}
	cout<<"No";
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
int arr[26],a=0,b=0;
string s;
int main(){
	cin>>s;
	for(int i=0;i<26;i++)arr[i]=0;
	for(int i=0;i<s.size();i++){
		arr[s[i]-97]++;
	}
	for(int i=0;i<26;i++){
		//cout<<arr[i]<<endl;
		if(arr[i]>0){
			if(arr[i]>1){
				a++;//cout<<"C";
			}else{
				b++;//cout<<"B";
			}
		}
	}
	if(a+b==2){
		if(a==2){
			cout<<"Yes";
		}else{
			cout<<"No";
		}
	}else{
		if(a+b==3){
			if(a>0) cout<<"Yes";
			else cout<<"No";
			return 0;
		}
		if(a+b==4){
			cout<<"Yes";
			return 0;
		}
		cout<<"No";
		return 0;
	}
	cout<<"No";
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
int arr[26],a=0,b=0;
string s;
int main(){
	cin>>s;
	for(int i=0;i<26;i++)arr[i]=0;
	for(int i=0;i<s.size();i++){
		arr[s[i]-97]++;
	}
	for(int i=0;i<26;i++){
		//cout<<arr[i]<<endl;
		if(arr[i]>0){
			if(arr[i]>1){
				a++;//cout<<"C";
			}else{
				b++;//cout<<"B";
			}
		}
	}
	if(a>1){
		cout<<"Yes";
	}else{
		if(b>1){
			cout<<"Yes";
		}else{
			cout<<"No";
		}
	}
}


#include <bits/stdc++.h>
using namespace std;

int main(){
	string word;
	cin >> word;
	map<char, int> counts;

	// Possible are
	// 2 even, 1 odd
	// 2 even, 2 odd
	// 1 even, 1 odd
	for(int i = 0; i < word.length(); i++){
		if(counts.find(word[i]) == counts.end()){
			counts[word[i]] = 1;
		} else {
			counts[word[i]]++;
		}
	}
	// All the counts now
	int even = 0;
	int odd = 0;
	for(map<char, int>::iterator it = counts.begin(); it != counts.end(); it++){
		if(it->second % 2 == 0){
			even++;
		} else {
			odd++;
		}
	}
	if((even == 2 && odd == 1) || (even == 2 && odd == 2) || (even == 1 && odd == 1) || (odd == 2 && even == 1)){
		if(even == 1 && odd == 1){
			// Check the 2 leng even and 1 leng odd case
			int odd_count = 0;
			int even_count = 0;
			for(map<char, int>::iterator it = counts.begin(); it != counts.end(); it++){
				if(it->second % 2 == 0){
					even_count = it->second;
				} else {
					odd_count = it->second;
				}
			}
			if(odd_count == 1){
				cout << "No" << endl;
				return 0;
			}
		}
		cout << "Yes" << endl;
	} else {
		cout << "No" << endl;
	}
}


#include <bits/stdc++.h>
using namespace std;

int main(){
	string word;
	cin >> word;
	map<char, int> counts;

	// Possible are
	// 2 even, 1 odd
	// 2 even, 2 odd
	// 1 even, 1 odd
	for(int i = 0; i < word.length(); i++){
		if(counts.find(word[i]) == counts.end()){
			counts[word[i]] = 1;
		} else {
			counts[word[i]]++;
		}
	}
	// All the counts now
	int even = 0;
	int odd = 0;
	for(map<char, int>::iterator it = counts.begin(); it != counts.end(); it++){
		if(it->second % 2 == 0){
			even++;
		} else {
			odd++;
		}
	}
	if((even == 2 && odd == 1) || (even == 2 && odd == 2) || (even == 1 && odd == 1) || (odd == 2 && even == 1)){
		cout << "Yes" << endl;
	} else {
		cout << "No" << endl;
	}
}


#include <bits/stdc++.h>
using namespace std;

int main(){
	string word;
	cin >> word;
	map<char, int> counts;

	// Possible are
	// 2 even, 1 odd
	// 2 even, 2 odd
	// 1 even, 1 odd
	for(int i = 0; i < word.length(); i++){
		if(counts.find(word[i]) == counts.end()){
			counts[word[i]] = 1;
		} else {
			counts[word[i]]++;
		}
	}
	// All the counts now
	int even = 0;
	int odd = 0;
	for(map<char, int>::iterator it = counts.begin(); it != counts.end(); it++){
		if(it->second % 2 == 0){
			even++;
		} else {
			odd++;
		}
	}
	// cout << "got even " << even << " got odd " << odd << endl;
	if((even == 2 && odd == 1) || (even == 2 && odd == 2) || (even == 1 && odd == 1) || (odd == 2 && even == 1)
		|| (even == 2 && odd == 0) || (even == 0 && odd == 2) || (even == 4 && odd == 0) || (even == 3 && odd == 1) ||
		(even == 1 && odd == 3) || (even == 0 && odd == 4) || (even == 0 && odd == 3) || (even == 3 && odd == 0)){
		if(even == 1 && odd == 1){
			// Check the 2 leng even and 1 leng odd case
			int odd_count = 0;
			int even_count = 0;
			for(map<char, int>::iterator it = counts.begin(); it != counts.end(); it++){
				if(it->second % 2 == 0){
					even_count = it->second;
				} else {
					odd_count = it->second;
				}
			}
			if(odd_count == 1){
				cout << "No" << endl;
				return 0;
			}
		} else if (even == 0 && odd == 2){
			// Check that both odd are not leng 1
			bool fail = false;
			for(map<char, int>::iterator it = counts.begin(); it != counts.end(); it++){
				if(it->second % 2 == 1){
					if(it->second == 1){
						fail = true;
					}
				}
			}
			if(fail){
				cout << "No" << endl;
				return 0;
			}
		} else if (even == 0 && odd == 3){
			// Check that both odd are not leng 1
			bool fail = true;
			for(map<char, int>::iterator it = counts.begin(); it != counts.end(); it++){
				if(it->second % 2 == 1){
					if(it->second != 1){
						fail = false;
					}
				}
			}
			if(fail){
				cout << "No" << endl;
				return 0;
			}
		}
		cout << "Yes" << endl;
	} else {
		cout << "No" << endl;
	}
}


#include <bits/stdc++.h>
using namespace std;

int main(){
	string word;
	cin >> word;
	map<char, int> counts;

	// Possible are
	// 2 even, 1 odd
	// 2 even, 2 odd
	// 1 even, 1 odd
	for(int i = 0; i < word.length(); i++){
		if(counts.find(word[i]) == counts.end()){
			counts[word[i]] = 1;
		} else {
			counts[word[i]]++;
		}
	}
	// All the counts now
	int even = 0;
	int odd = 0;
	for(map<char, int>::iterator it = counts.begin(); it != counts.end(); it++){
		if(it->second % 2 == 0){
			even++;
		} else {
			odd++;
		}
	}
	if((even == 2 && odd == 1) || (even == 2 && odd == 2) || (even == 1 && odd == 1) || (odd == 2 && even == 1)
		|| (even == 2 && odd == 0) || (even == 0 && odd == 2) || (even == 4 && odd == 0) || (even == 3 && odd == 1) ||
		(even == 1 && odd == 3) || (even == 0 && odd == 4) || (even == 0 && odd == 3)){
		if(even == 1 && odd == 1){
			// Check the 2 leng even and 1 leng odd case
			int odd_count = 0;
			int even_count = 0;
			for(map<char, int>::iterator it = counts.begin(); it != counts.end(); it++){
				if(it->second % 2 == 0){
					even_count = it->second;
				} else {
					odd_count = it->second;
				}
			}
			if(odd_count == 1){
				cout << "No" << endl;
				return 0;
			}
		} else if (even == 0 && odd == 2){
			// Check that both odd are not leng 1
			bool fail = false;
			for(map<char, int>::iterator it = counts.begin(); it != counts.end(); it++){
				if(it->second % 2 == 1){
					if(it->second == 1){
						fail = true;
					}
				}
			}
			if(fail){
				cout << "No" << endl;
				return 0;
			}
		} else if (even == 0 && odd == 3){
			// Check that both odd are not leng 1
			bool fail = true;
			for(map<char, int>::iterator it = counts.begin(); it != counts.end(); it++){
				if(it->second % 2 == 1){
					if(it->second != 1){
						fail = false;
					}
				}
			}
			if(fail){
				cout << "No" << endl;
				return 0;
			}
		}
		cout << "Yes" << endl;
	} else {
		cout << "No" << endl;
	}
}


#include <bits/stdc++.h>
using namespace std;

int main(){
	string word;
	cin >> word;
	map<char, int> counts;

	// Possible are
	// 2 even, 1 odd
	// 2 even, 2 odd
	// 1 even, 1 odd
	for(int i = 0; i < word.length(); i++){
		if(counts.find(word[i]) == counts.end()){
			counts[word[i]] = 1;
		} else {
			counts[word[i]]++;
		}
	}
	// All the counts now
	int even = 0;
	int odd = 0;
	for(map<char, int>::iterator it = counts.begin(); it != counts.end(); it++){
		if(it->second % 2 == 0){
			even++;
		} else {
			odd++;
		}
	}
	if((even == 2 && odd == 1) || (even == 2 && odd == 2) || (even == 1 && odd == 1) || (odd == 2 && even == 1)
		|| (even == 2 && odd == 0) || (even == 0 && odd == 2) || (even == 4 && odd == 0) || (even == 3 && odd == 1) ||
		(even == 1 && odd == 3) || (even == 0 && odd == 4)){
		if(even == 1 && odd == 1){
			// Check the 2 leng even and 1 leng odd case
			int odd_count = 0;
			int even_count = 0;
			for(map<char, int>::iterator it = counts.begin(); it != counts.end(); it++){
				if(it->second % 2 == 0){
					even_count = it->second;
				} else {
					odd_count = it->second;
				}
			}
			if(odd_count == 1){
				cout << "No" << endl;
				return 0;
			}
		} else if (even == 0 && odd == 2){
			// Check that both odd are not leng 1
			bool fail = false;
			for(map<char, int>::iterator it = counts.begin(); it != counts.end(); it++){
				if(it->second % 2 == 1){
					if(it->second == 1){
						fail = true;
					}
				}
			}
			if(fail){
				cout << "No" << endl;
				return 0;
			}
		}
		cout << "Yes" << endl;
	} else {
		cout << "No" << endl;
	}
}


#include <bits/stdc++.h>
using namespace std;

int main(){
	string word;
	cin >> word;
	map<char, int> counts;

	// Possible are
	// 2 even, 1 odd
	// 2 even, 2 odd
	// 1 even, 1 odd
	for(int i = 0; i < word.length(); i++){
		if(counts.find(word[i]) == counts.end()){
			counts[word[i]] = 1;
		} else {
			counts[word[i]]++;
		}
	}
	// All the counts now
	int even = 0;
	int odd = 0;
	for(map<char, int>::iterator it = counts.begin(); it != counts.end(); it++){
		if(it->second % 2 == 0){
			even++;
		} else {
			odd++;
		}
	}
	if((even == 2 && odd == 1) || (even == 2 && odd == 2) || (even == 1 && odd == 1) || (odd == 2 && even == 1)
		|| (even == 2 && odd == 0) || (even == 0 && odd == 2)){
		if(even == 1 && odd == 1){
			// Check the 2 leng even and 1 leng odd case
			int odd_count = 0;
			int even_count = 0;
			for(map<char, int>::iterator it = counts.begin(); it != counts.end(); it++){
				if(it->second % 2 == 0){
					even_count = it->second;
				} else {
					odd_count = it->second;
				}
			}
			if(odd_count == 1){
				cout << "No" << endl;
				return 0;
			}
		} else if (even == 0 && odd == 2){
			// Check that both odd are not leng 1
			bool fail = false;
			for(map<char, int>::iterator it = counts.begin(); it != counts.end(); it++){
				if(it->second % 2 == 1){
					if(it->second == 1){
						fail = true;
					}
				}
			}
			if(fail){
				cout << "No" << endl;
				return 0;
			}
		}
		cout << "Yes" << endl;
	} else {
		cout << "No" << endl;
	}
}


#include <bits/stdc++.h>
using namespace std;

int main(){
	string word;
	cin >> word;
	map<char, int> counts;

	// Possible are
	// 2 even, 1 odd
	// 2 even, 2 odd
	// 1 even, 1 odd
	for(int i = 0; i < word.length(); i++){
		if(counts.find(word[i]) == counts.end()){
			counts[word[i]] = 1;
		} else {
			counts[word[i]]++;
		}
	}
	// All the counts now
	int even = 0;
	int odd = 0;
	for(map<char, int>::iterator it = counts.begin(); it != counts.end(); it++){
		if(it->second % 2 == 0){
			even++;
		} else {
			odd++;
		}
	}
	if((even == 2 && odd == 1) || (even == 2 && odd == 2) || (even == 1 && odd == 1) || (odd == 2 && even == 1)
		|| (even == 2 && odd == 0) || (even == 0 && odd == 2) || (even == 4 && odd == 0) || (even == 3 && odd == 1) ||
		(even == 1 && odd == 3) || (even == 0 && odd == 4)){
		if(even == 1 && odd == 1){
			// Check the 2 leng even and 1 leng odd case
			int odd_count = 0;
			int even_count = 0;
			for(map<char, int>::iterator it = counts.begin(); it != counts.end(); it++){
				if(it->second % 2 == 0){
					even_count = it->second;
				} else {
					odd_count = it->second;
				}
			}
			if(odd_count == 1){
				cout << "No" << endl;
				return 0;
			}
		} else if (even == 0 && odd == 2){
			// Check that both odd are not leng 1
			bool fail = false;
			for(map<char, int>::iterator it = counts.begin(); it != counts.end(); it++){
				if(it->second % 2 == 1){
					if(it->second == 1){
						fail = true;
					}
				}
			}
			if(fail){
				cout << "No" << endl;
				return 0;
			}
		} else if (even == 0 && odd == 3){
			// Check that both odd are not leng 1
			bool fail = true;
			for(map<char, int>::iterator it = counts.begin(); it != counts.end(); it++){
				if(it->second % 2 == 1){
					if(it->second != 1){
						fail = false;
					}
				}
			}
			if(fail){
				cout << "No" << endl;
				return 0;
			}
		}
		cout << "Yes" << endl;
	} else {
		cout << "No" << endl;
	}
}


#include <bits/stdc++.h>
using namespace std;

int main(){
	string word;
	cin >> word;
	map<char, int> counts;

	// Possible are
	// 2 even, 1 odd
	// 2 even, 2 odd
	// 1 even, 1 odd
	for(int i = 0; i < word.length(); i++){
		if(counts.find(word[i]) == counts.end()){
			counts[word[i]] = 1;
		} else {
			counts[word[i]]++;
		}
	}
	// All the counts now
	int even = 0;
	int odd = 0;
	for(map<char, int>::iterator it = counts.begin(); it != counts.end(); it++){
		if(it->second % 2 == 0){
			even++;
		} else {
			odd++;
		}
	}
	if((even == 2 && odd == 1) || (even == 2 && odd == 2) || (even == 1 && odd == 1)){
		cout << "Yes" << endl;
	} else {
		cout << "No" << endl;
	}
}


#include <vector>
#include <map>
#include <list>
#include <iostream>
#include <sstream>
#include <algorithm>
using namespace std;

map<int, int> seen; // 0 not seen, 1 is seen
vector<vector<int>> adj; // adjacency matrix
vector<vector<int>> rev_adj; // reversed direction adjaceny matrix

list<int> component_sizes;
int global_counter; // Used to store parts of a component, and then cleared later

int numVert;
int numEdge;

// m1 >= m2 >= m3 >= m4 >= m5;
int m1 = 0;
int m2 = 0;
int m3 = 0;
int m4 = 0;
int m5 = 0;

// Stack used for algorithm
vector<int> stack;

void printstack(){
	for(int v : stack){
		cout << v << " ";
	}
	cout << endl;
}

void newnum(int val){
	if(val >= m1){
		m5 = m4;
		m4 = m3;
		m3 = m2;
		m2 = m1;
		m1 = val;
	} else if (val >= m2){
		m5 = m4;
		m4 = m3;
		m3 = m2;
		m2 = val;
	} else if (val >= m3){
		m5 = m4;
		m4 = m3;
		m3 = val;
	} else if (val >= m4){
		m5 = m4;
		m4 = val;
	} else if (val >= m5){
		m5 = val;
	}
}

// Updates stack based off of DFS
// local_seen updates the seen locally, but just not to the global seen (to not allow endless cycles)
void dfs(int vert, vector<vector<int>> &graph){
	// Already went to this node before
	if(seen[vert] == 1){
		return;
	}

	seen[vert] = 1;

	// For each of the outward edges to
	for(int i = 1; i < adj.size(); i++){
		// If it has been seen locally or globally, end search
		if(seen[i] == 1){
			// Skip the value
			continue;
		}
		// If there is a directed edge from vert -> i
		if(graph[vert][i] == 1){
			// Go deeper
			dfs(i, graph);
		}
	}
	// At the END add to seen
	stack.push_back(vert);
	global_counter++; // Haven't seen it so far so add it in
}

void Kosaraju(){
	// DFS and use stack
	for(int i = 1; i < numVert+1; i++){
		dfs(i, adj);
	}

	// store endpoints of recursion
	// printstack();

	// Reverse all directions
	// rev_adj is made already

	// clear seen
	for(int i = 0; i < numVert+1; i++){
		seen[i] = 0;
	}

	global_counter = 0;

	// DFS on popping stack, marking what has been seen already
	int stack_size = stack.size();
	for(int i = stack_size-1; i >= 1; i--){
		int val = stack[i];

		// if already seen skip it
		if(seen[stack[i]] == 1){
			// cout << "skipped " << stack[i] << endl;
			continue;
		}

		dfs(val, rev_adj);
		// cout << "stored " << global_counter << endl;
		component_sizes.push_back(global_counter);
		global_counter = 0;
	}
	list<int> m;

	// component_sizes.sort();

	// This edits m1-m5
	for(int val : component_sizes){
		newnum(val);
	}

	m.push_back(m1);
	m.push_back(m2);
	m.push_back(m3);
	m.push_back(m4);
	m.push_back(m5);

	/*
	int counter = 0;
	while(component_sizes.size() > 0 && counter < 5){
		m.push_back(component_sizes.back());
		component_sizes.pop_back();
		counter++;
	}

	while(m.size() < 5){
		m.push_back(0);
	}
	*/

	// Done
	for(auto v : m){
		cout << v << "\t";
	}
	cout << endl;
}

int main(){
	string line;
	cin >> numVert;
	cin >> numEdge;

	// Make adjacency matrix and seen
	adj.resize(numVert+1);
	rev_adj.resize(numVert+1);
	for(int i = 0; i < numVert+1; i++){
		adj[i].resize(numVert+1);
		rev_adj[i].resize(numVert+1);
	}

	for(int i = 0; i < numVert+1; i++){
		seen[i] = 0;
	}

	getline(cin, line); // clear line
	for(int i = 0; i < numEdge; i++){
		getline(cin, line);
		istringstream iss{line};
		int u = 0;
		int v = 0;
		iss >> u >> v;
		adj[u][v] = 1; // Only want u -> v
		// Make the reverse one as well
		rev_adj[v][u] = 1;
	}

	Kosaraju();
}


#include<bits/stdc++.h>
using namespace std;
int64_t ar[10000];
int main()
{
    int64_t b,bb,c,cc,e=0,f=1,i=0,d=0;
    priority_queue<int64_t>pq;
    vector<int64_t>sss;
    string ss;
    cin>>ss;
    for(int i=0;i<ss.size();i++)
    {
        ar[ss[i]-'a']++;
    }
    for(int i=0;i<26;i++)if(ar[i]==1)d++;
    else if(ar[i]>1) e++;
    if(e>=2||(e&&e+d>2)||d>3)cout<<"YES";
    else cout<<"NO";
}


#include<bits/stdc++.h>
using namespace std;
int64_t ar[10000];
int main()
{
    int64_t b,bb,c,cc,e=0,f=1,i=0,d=0;
    priority_queue<int64_t>pq;
    vector<int64_t>sss;
    string ss;
    cin>>ss;
    for(int i=0;i<ss.size();i++)
    {
        ar[ss[i]-'a']++;
    }
    for(int i=0;i<26;i++)if(ar[i]==1)d++;
    else if(ar[i]>1) e++;
    if(e>2||(e+d>2))cout<<"YES";
    else cout<<"NO";
}


#include<bits/stdc++.h>
using namespace std;
//int64_t ar[1000000000];
int main()
{
    int64_t b,bb,c,cc,e=0,f=1,i=0,d=0;
    priority_queue<int64_t>pq;
    vector<int64_t>sss;
    cin>>b>>c>>d>>e>>cc>>f;
    double ff=(double)d;
    ff=(int)(ff/f)+(d%f!=0);
    //cout<<ff;
    ff*=cc;
    if(b<20){
        c=(60-c);
        bb=20-b-1;
        bb=(bb*60)+c;
        bb*=e;
        bb+=d;
        double dd=(double)bb;
        dd=(dd/f)*1.0+(bb%f!=0);
        if(cc*dd*80/100<ff){cout << fixed << setprecision(5) <<(cc*bb*.8);return 0;}
    }
    cout << fixed << setprecision(5) << ff;

}


#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

int a[100010];
int b[100010];

int main()
{
    int f=1,g=1;
    set<char>s;
    string n;
    cin >> n;
    for(int i=0;i<n.size();i++){a[n[i]-'a']++;s.insert(n[i]);}
    for(int i=0;i<26;i++)if(a[i]==1){f=0;break;}
    if(n.size()<4)g=0;
        else if(s.size()>4)g=0;
        else if(s.size()==2&&!f)g=0;
            else if(s.size()==1)g=0;
        if(g)cout<<"Yes";
        else cout<<"No";
}


#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

int a[100010];
int b[100010];

int main()
{
    int f=1,g=1;
    set<char>s;
    string n;
    cin >> n;
    for(int i=0;i<n.size();i++){a[n[i]-'a']++;s.insert(n[i]);}
    for(int i=0;i<26;i++){if(a[i]==1)f=0;break;}
    if(n.size()<4)g=0;
        else if(s.size()>4)g=0;
        else if(s.size()==2&&f)g=0;
            else if(s.size()==1)g=0;
        if(g)cout<<"Yes";
        else cout<<"No";
}


#include<bits/stdc++.h>
using namespace std;
int64_t ar[10000];
int main()
{
    int64_t b,bb,c,cc,e=0,f=1,i=0,d=0;
    priority_queue<int64_t>pq;
    vector<int64_t>sss;
    string ss;
    cin>>ss;
    for(int i=0;i<ss.size();i++)
    {
        ar[ss[i]-'a']++;
    }
    for(int i=0;i<26;i++)if(ar[i]==1)d++;
    else if(ar[i]>1) e++;
    if(e>2||(e&&e+f>2))cout<<"YES";
    else cout<<"NO";
}


#include<bits/stdc++.h>
using namespace std;
int64_t ar[10000];
int main()
{
    int64_t b,bb,c,cc,e=0,f=1,i=0,d=0;
    priority_queue<int64_t>pq;
    vector<int64_t>sss;
    string ss;
    cin>>ss;
    for(int i=0;i<ss.size();i++)
    {
        ar[ss[i]-'a']++;
    }
    for(int i=0;i<26;i++)if(ar[i]==1)d++;
    else if(ar[i]>1) e++;
    ifif(d == 4 || (d == 3 && e >= 1) || (d == 2 && e >= 2))cout<<"YES";
    else cout<<"NO";
}


#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

int a[100010];
int b[100010];

int main()
{
    int f=1,g=1;
    set<char>s;
    string n
    cin >> n;
    for(int i=0;i<n.size();i++){a[s[i]-'a']++;s.insert(s[i]);}
    for(int i=0;i<26;i++){if(a[i]==1)f=0;break;}
    if(n.size()<4)g=0;
        else if(s.size()>4)g=0;
        else if(s.size()==2&&f)g=0;
            else if(s.size()==1)g=0;
        if(g)cout<<"Yes";
        else cout<<"No";
}


#include<bits/stdc++.h>
using namespace std;
int64_t ar[10000];
int main()
{
    int64_t b,bb,c,cc,e=0,f=1,i=0,d=0;
    priority_queue<int64_t>pq;
    vector<int64_t>sss;
    string ss;
    cin>>ss;
    for(int i=0;i<ss.size();i++)
    {
        ar[ss[i]-'a']++;
    }
    for(int i=0;i<26;i++)if(ar[i]==1)d++;
    else if(ar[i]>1) e++;
    if(d == 4 || (d == 3 && e >= 1) || (d == 2 && e >= 2))cout<<"YES";
    else cout<<"NO";
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long int
#define mx 500005
int a[mx];

int main()
{

   int n,i,j,k,res,co,cnn;
   int fl=0;
   string ss;
   cin>>ss;
   for(i=0;i<ss.size();i++)
   {
       a[ss[i]-'a']++;
   }
   co=0;
   for(i=0;i<50;i++)
   {
       if(a[i]!=0)co++;
   }
   if(co>=4)
   {
       cout<<"yes"<<'\n';
   }
   else if(co==3)
   {
       fl=0;
       for(i=0;i<50;i++)
       {
           if(a[i]>=2)fl=1;
       }
       if(fl==1)
       {
           cout<<"Yes"<<'\n';
       }
       else cout<<"No"<<'\n';
   }
   else if(co==2)
   {
       cnn=0;
       for(i=0;i<50;i++)
       {
           if(a[i]>=2)cnn++;
       }
       if(cnn>=2)
       {
           cout<<"Yes"<<'\n';
       }
       else cout<<"No"<<'\n';
   }
   else cout<<"No"<<'\n';
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long int
#define mx 500005
int a[mx];

int main()
{

   int n,i,j,k,res,co,cnn;
   int fl=0;
   string ss;
   cin>>ss;
   for(i=0;i<ss.size();i++)
   {
       a[ss[i]-'a']++;
   }
   co=0;
   for(i=0;i<50;i++)
   {
       if(a[i]!=0)co++;
   }
   if(co>4)
   {
       cout<<"No"<<'\n';
   }
   if(co==4)
   {
       cout<<"yes"<<'\n';
   }
   else if(co==3)
   {
       fl=0;
       for(i=0;i<50;i++)
       {
           if(a[i]>=2)fl=1;
       }
       if(fl==1)
       {
           cout<<"Yes"<<'\n';
       }
       else cout<<"No"<<'\n';
   }
   else if(co==2)
   {
       cnn=0;
       for(i=0;i<50;i++)
       {
           if(a[i]>=2)cnn++;
       }
       if(cnn>=2)
       {
           cout<<"Yes"<<'\n';
       }
       else cout<<"No"<<'\n';
   }
   else cout<<"No"<<'\n';
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long int
#define mx 500005
int a[mx];

int main()
{

   int n,i,j,k,res,co,cnn;
   int fl=0;
   string ss;
   cin>>ss;
   for(i=0;i<ss.size();i++)
   {
       a[ss[i]-'a']++;
   }
   co=0;
   for(i=0;i<50;i++)
   {
       if(a[i]!=0)co++;
   }
   if(co>4)
   {
       cout<<"No"<<'\n';
   }
   else if(co==4)
   {
       cout<<"yes"<<'\n';
   }
   else if(co==3)
   {
       fl=0;
       for(i=0;i<50;i++)
       {
           if(a[i]>=2)fl=1;
       }
       if(fl==1)
       {
           cout<<"Yes"<<'\n';
       }
       else cout<<"No"<<'\n';
   }
   else if(co==2)
   {
       cnn=0;
       for(i=0;i<50;i++)
       {
           if(a[i]>=2)cnn++;
       }
       if(cnn>=2)
       {
           cout<<"Yes"<<'\n';
       }
       else cout<<"No"<<'\n';
   }
   else cout<<"No"<<'\n';
    return 0;
}


#include <cstdio>
#include <iostream>
#include <cstring>
#include <algorithm>
#include <string>
#include <queue>
#include <stack>
#include <cmath>
#include <map>
#include <vector>
#include <functional>
#include <ctime>
#include <cstdlib>
#include <sstream>
#include <set>
#include <deque>
using namespace std;
char c[100005];
int b[100005],tot,v[100005],d[100005];
int main()
{
	//freopen("a.in","r",stdin);
	while (scanf("%s",c+1)!=EOF)
	{
		tot=0;
		for (int i=1;i<=26;i++) v[i]=0;
		int n=strlen(c+1);
		for (int i=1;i<=n/2;i++)
		{
			int x=c[i]-96,xx=c[n-i+1]-96;
			if (!v[x])
			{
				v[x]=1;
				d[x]=++tot;
				b[tot]=1;
			}
			else b[d[x]]++;
			if (!v[xx])
			{
				v[xx]=1;
				d[xx]=++tot;
				b[tot]=1;
			}
			else b[d[xx]]++;
			if (tot>4) break;
		}
		if (n%2)
		{
			int x=v[n/2+1]-96;
			if (!v[x])
			{
				v[x]=1;
				d[x]=++tot;
				b[tot]=1;
			}
			else b[d[x]]++;
		}
		if (tot>4 || tot<2) printf("No\n");
		else
		if (tot==2)
		{
			int ff=0;
			for (int i=1;i<=tot;i++)
			{
				if (b[i]<2) ff=1;
			}
			if (ff==1) printf("No\n");
			else printf("Yes\n");
		}
		else
		if (tot==3)
		{
			int ff=0;
			for (int i=1;i<=tot;i++)
			{
				if (b[i]<2) ff++;
			}
			if (ff==3) printf("No\n");
			else  printf("Yes\n");
		}
		else
		if (tot==4 ) printf("Yes\n");
	}
}


#include <cstdio>
#include <iostream>
#include <cstring>
#include <algorithm>
#include <string>
#include <queue>
#include <stack>
#include <cmath>
#include <map>
#include <vector>
#include <functional>
#include <ctime>
#include <cstdlib>
#include <sstream>
#include <set>
#include <deque>
using namespace std;
char c[100005];
int b[100005],tot,v[100005],d[100005];
int main()
{
	//freopen("a.in","r",stdin);
	while (scanf("%s",c+1)!=EOF)
	{
		tot=0;
		for (int i=1;i<=26;i++) v[i]=0;
		int n=strlen(c+1);
		for (int i=1;i<=n/2;i++)
		{
			int x=c[i]-96,xx=c[n-i+1]-96;
			if (!v[x])
			{
				v[x]=1;
				d[x]=++tot;
				b[tot]=1;
			}
			else b[d[x]]++;
			if (!v[xx])
			{
				v[xx]=1;
				d[xx]=++tot;
				b[tot]=1;
			}
			else b[d[xx]]++;
			if (tot>4) break;
		}
		if (n%2)
		{
			int x=c[n/2+1]-96;
			if (!v[x])
			{
				v[x]=1;
				d[x]=++tot;
				b[tot]=1;
			}
			else b[d[x]]++;
		}
		if (tot>4 || tot<2) printf("No\n");
		else
		if (tot==2)
		{
			int ff=0;
			for (int i=1;i<=tot;i++)
			{
				if (b[i]<2) ff=1;
			}
			if (ff==1) printf("No\n");
			else printf("Yes\n");
		}
		else
		if (tot==3)
		{
			int ff=0;
			for (int i=1;i<=tot;i++)
			{
				if (b[i]<2) ff++;
			}
			if (ff==3) printf("No\n");
			else  printf("Yes\n");
		}
		else
		if (tot==4 ) printf("Yes\n");
	}
}


#include <cstdio>
#include <iostream>
#include <cstring>
#include <algorithm>
#include <string>
#include <queue>
#include <stack>
#include <cmath>
#include <map>
#include <vector>
#include <functional>
#include <ctime>
#include <cstdlib>
#include <sstream>
#include <set>
#include <deque>
using namespace std;
char c[100005],a[100005];
int b[100005],tot,v[100005],d[100005];
int main()
{
	//freopen("a.in","r",stdin);
	while (scanf("%s",c+1)!=EOF)
	{
		tot=0;
		for (int i=1;i<=26;i++) v[i]=0;
		for (int i=1;i<=strlen(c+1);i++)
		{
			int x=c[i]-64;
			if (!v[x])
			{
				v[x]=1;
				tot++;
				d[x]=tot;
				a[tot]=c[i];
				b[tot]=1;
			}
			else b[d[x]]++;
			if (tot>4) break;
		}
		if (tot>4 || tot<2) printf("No\n");
		else
		if (tot==2)
		{
			int ff=0;
			for (int i=1;i<=tot;i++)
			{
				if (b[i]<2) ff=1;
			}
			if (ff==1) printf("No\n");
			else printf("Yes\n");
		}
		else
		if (tot==3)
		{
			int ff=0;
			for (int i=1;i<=tot;i++)
			{
				if (b[i]<2) ff++;
			}
			if (ff==3) printf("No\n");
			else  printf("Yes\n");
		}
		else
		if (tot==4 ) printf("Yes\n");
	}
}


#include <cstdio>
#include <iostream>
#include <cstring>
#include <algorithm>
#include <string>
#include <queue>
#include <stack>
#include <cmath>
#include <map>
#include <vector>
#include <functional>
#include <ctime>
#include <cstdlib>
#include <sstream>
#include <set>
#include <deque>
using namespace std;
char c[100005],a[100005];
int b[100005],tot;
int main()
{
	//	freopen("a.in","r",stdin);
	while (scanf("%s",c+1)!=EOF)
	{
		tot=0;
		for (int i=1;i<=strlen(c+1);i++)
		{
			int f=0;
			for (int j=1;j<=tot;j++)
			if (a[j]==c[i])
			{
				f=1;
				b[j]++;
				break;
			}
			if (!f)
			{
				tot++;
				a[tot]=c[i];
				b[tot]=1;
			}
			if (tot>4) break;
		}
		if (tot>4 || tot<2) printf("No\n");
		else
		if (tot==2)
		{
			int ff=0;
			for (int i=1;i<=tot;i++)
			{
				if (b[i]<2) ff=1;
			}
			if (ff==1) printf("No\n");
			else printf("Yes\n");
		}
		else
		if (tot==3)
		{
			int ff=0;
			for (int i=1;i<=tot;i++)
			{
				if (b[i]<2) ff++;
			}
			if (ff==3) printf("No\n");
			else  printf("Yes\n");
		}
		else
		if (tot==4 ) printf("Yes\n");
	}
}


#include <cstdio>
#include <iostream>
#include <cstring>
#include <algorithm>
#include <string>
#include <queue>
#include <stack>
#include <cmath>
#include <map>
#include <vector>
#include <functional>
#include <ctime>
#include <cstdlib>
#include <sstream>
#include <set>
#include <deque>
using namespace std;
char c[100005],a[100005];
int b[100005],tot,v[100005],d[100005];
int main()
{
	//freopen("a.in","r",stdin);
	while (scanf("%s",c+1)!=EOF)
	{
		tot=0;
		for (int i=1;i<=30;i++) v[i]=0;
		for (int i=1;i<=strlen(c+1);i++)
		{
			int x=c[i]-96;
			if (!v[x])
			{
				v[x]=1;
				tot++;
				d[x]=tot;
				a[tot]=c[i];
				b[tot]=1;
			}
			else b[d[x]]++;
			if (tot>4) break;
		}
		if (tot>4 || tot<2) printf("No\n");
		else
		if (tot==2)
		{
			int ff=0;
			for (int i=1;i<=tot;i++)
			{
				if (b[i]<2) ff=1;
			}
			if (ff==1) printf("No\n");
			else printf("Yes\n");
		}
		else
		if (tot==3)
		{
			int ff=0;
			for (int i=1;i<=tot;i++)
			{
				if (b[i]<2) ff++;
			}
			if (ff==3) printf("No\n");
			else  printf("Yes\n");
		}
		else
		if (tot==4 ) printf("Yes\n");
	}
}


#include <stdio.h>
#include <string.h>
char S[100001];
int alpha[26]={0};
int main(int argc, char *argv[]){
	int i, len, count_al, check_one;
	scanf("%s", S);
	len = strlen(S);
	count_al = 0;
	for(i=0; i<len; i++){
		if(alpha[S[i]-'a']==0) count_al++;
		alpha[S[i]-'a']++;
	}
	if(len<4){
		printf("No\n");
	} else if (count_al==1){
		printf("No\n");
	} else if(count_al==2){
		check_one=0;
		for(i=0; i<26; i++)
			if(alpha[i]==1) check_one=1;
		if(check_one==1) printf("No\n");
		else printf("Yes\n");
	} else {
		printf("Yes\n");
	}
   return 0;
}


#include <stdio.h>
#include <string.h>
char S[100005];
int alpha[26]={0};
int main(int argc, char *argv[]){
	int i, len, count_al, check_one;
	scanf("%s", S);
	len = strlen(S);
	count_al = 0;
	for(i=0; i<len; i++){
		if(alpha[S[i]-'a']==0) count_al++;
		alpha[S[i]-'a']++;
	}
	if(len<4){
		printf("No");
	} else if (count_al<=1){
		printf("No");
	} else if(count_al==2){
		check_one=0;
		for(i=0; i<26; i++)
			if(alpha[i]==1) check_one=1;
		if(check_one==1) printf("No");
		else printf("Yes");
	} else {
		printf("Yes");
	}
   return 0;
}


#include <stdio.h>
#include <string.h>
char S[10001];
int alpha[26]={0};
int main(int argc, char *argv[]){
	int i, len, count_al, check_one;
	scanf("%s", S);
	len = strlen(S);
	count_al=0;
	for(i=0; i<len; i++){
		if(alpha[S[i]-'a']==0) count_al++;
		alpha[S[i]-'a']++;
	}
	if(len<4){
		printf("No\n");
	} else if(count_al==2){
		check_one=0;
		for(i=0; i<26; i++)
			if(alpha[i]==1) check_one=1;
		if(check_one==1) printf("No\n");
		else printf("Yes\n");
	} else {
		printf("Yes\n");
	}
   return 0;
}


#include <stdio.h>
#include <string.h>
char S[10001];
int alpha[26]={0};
int main(int argc, char *argv[]){
	int i, len, count_al, check_one;
	scanf("%s", S);
	len = strlen(S);
	count_al=0;
	for(i=0; i<len; i++){
		if(alpha[S[i]-'a']==0) count_al++;
		alpha[S[i]-'a']++;
	}
	if(count_al==1){
		if(len<3) printf("Yes\n");
		else printf("No\n");
	} else if(count_al==2){
		check_one=0;
		for(i=0; i<26; i++)
			if(alpha[i]==1) check_one=1;
		if(check_one==1) printf("No\n");
		else printf("Yes\n");
	} else {
		printf("Yes\n");
	}
   return 0;
}


#include <stdio.h>
#include <string.h>
char S[100001];
int alpha[26]={0};
int main(int argc, char *argv[]){
	int i, len, count_al, check_one;
	scanf("%s", S);
	len = strlen(S);
	count_al = 0;
	for(i=0; i<len; i++){
		if(alpha[S[i]-'a']==0) count_al++;
		alpha[S[i]-'a']++;
	}
	if(len<4){
		printf("No\n");
	} else if (count_al<=1){
		printf("No\n");
	} else if(count_al==2){
		check_one=0;
		for(i=0; i<26; i++)
			if(alpha[i]==1) check_one=1;
		if(check_one==1) printf("No\n");
		else printf("Yes\n");
	} else {
		printf("Yes\n");
	}
   return 0;
}


#include <stdio.h>
#include <string.h>
char S[100001];
int alpha[26]={0};
int main(int argc, char *argv[]){
	int i, len, count_al, check_one;
	scanf("%s", S);
	len = strlen(S);
	count_al = 0;
	for(i=0; i<len; i++){
		if(alpha[S[i]-'a']==0) count_al++;
		alpha[S[i]-'a']++;
	}
	if(len<4){
		printf("No\n");
	} else if(count_al==2){
		check_one=0;
		for(i=0; i<26; i++)
			if(alpha[i]==1) check_one=1;
		if(check_one==1) printf("No\n");
		else printf("Yes\n");
	} else {
		printf("Yes\n");
	}
   return 0;
}


#include <stdio.h>
#include <string.h>
char S[100005];
int alpha[26]={0};
int main(int argc, char *argv[]){
	int i, len, count_al, check_one;
	scanf("%s", S);
	len = strlen(S);
	count_al = 0;
	for(i=0; i<len; i++){
		if(alpha[S[i]-'a']==0) count_al++;
		alpha[S[i]-'a']++;
	}
	if(len<=2){
		printf("Yes\n");
	} else if (count_al<=1){
		printf("No\n");
	} else if(count_al==2){
		check_one=0;
		for(i=0; i<26; i++)
			if(alpha[i]==1) check_one=1;
		if(check_one==1) printf("No\n");
		else printf("Yes\n");
	} else {
		printf("Yes\n");
	}
   return 0;
}


#include <stdio.h>
#include <string.h>
char S[10001];
int alpha[26]={0};
int main(int argc, char *argv[]){
	int i, len, count_al, check_one;
	scanf("%s", S);
	len = strlen(S);
	count_al=0;
	for(i=0; i<len; i++){
		if(alpha[S[i]-'a']==0) count_al++;
		alpha[S[i]-'a']++;
	}
	if(count_al==1){
		if(len<2) printf("Yes\n");
		else printf("No\n");
	} else if(count_al==2){
		check_one=0;
		for(i=0; i<26; i++)
			if(alpha[i]==1) check_one=1;
		if(check_one==1) printf("No\n");
		else printf("Yes\n");
	} else {
		printf("Yes\n");
	}
   return 0;
}


#include <stdio.h>
#include <string.h>
char S[10001];
int alpha[26]={0};
int main(int argc, char *argv[]){
	int i, len, count_al, check_one;
	scanf("%s", S);
	len = strlen(S);
	count_al=0;
	for(i=0; i<len; i++){
		if(alpha[S[i]-'a']==0) count_al++;
		alpha[S[i]-'a']++;
	}
	if(count_al==1){
		printf("No\n");
	} if(count_al==2){
		check_one=0;
		for(i=0; i<26; i++)
			if(alpha[i]==1) check_one=1;
		if(check_one==1) printf("No\n");
		else printf("Yes\n");
	} else {
		printf("Yes\n");
	}
   return 0;
}


#include <stdio.h>
#include <string.h>
char S[100001];
int alpha[26]={0};
int main(int argc, char *argv[]){
	int i, len, count_al, check_one;
	scanf("%s", S);
	len = strlen(S);
	count_al = 0;
	for(i=0; i<len; i++){
		if(S[i]>='a' && S[i]<='z'){
			if(alpha[S[i]-'a']==0) count_al++;
			alpha[S[i]-'a']++;
		}
	}
	if(len<4){
		printf("No\n");
	} else if (count_al<=1){
		printf("No\n");
	} else if(count_al==2){
		check_one=0;
		for(i=0; i<26; i++)
			if(alpha[i]==1) check_one=1;
		if(check_one==1) printf("No\n");
		else printf("Yes\n");
	} else {
		printf("Yes\n");
	}
   return 0;
}


#include <stdio.h>
#include <string.h>
char S[100005];
int alpha[26]={0};
int main(int argc, char *argv[]){
	int i, len, count_al, check_one;
	scanf("%s", S);
	len = strlen(S);
	count_al = 0;
	for(i=0; i<len; i++){
		if(alpha[S[i]-'a']==0) count_al++;
		alpha[S[i]-'a']++;
	}
	if(len<4){
		printf("No\n");
	} else if (count_al<=1){
		printf("No\n");
	} else if(count_al==2){
		check_one=0;
		for(i=0; i<26; i++)
			if(alpha[i]==1) check_one=1;
		if(check_one==1) printf("No\n");
		else printf("Yes\n");
	} else {
		printf("Yes\n");
	}
   return 0;
}


#include <stdio.h>
#include <string.h>
char S[100005];
int alpha[26]={0};
int main(int argc, char *argv[]){
	int i, len, count_al, check_one;
	scanf("%s", S);
	len = strlen(S);
	count_al = 0;
	for(i=0; i<len; i++){
		if(alpha[S[i]-'a']==0) count_al++;
		alpha[S[i]-'a']++;
	}
	if(len<4){
		printf("No\n");
	} else if (count_al<=1){
		printf("No\n");
	} else if (count_al>4){
		printf("No\n");
	} else if(count_al==2){
		check_one=0;
		for(i=0; i<26; i++)
			if(alpha[i]==1) check_one=1;
		if(check_one==1) printf("No\n");
		else printf("Yes\n");
	} else {
		printf("Yes\n");
	}
   return 0;
}


#include <stdio.h>
#include <string.h>
char S[100005];
int alpha[26]={0};
int main(int argc, char *argv[]){
	int i, len, count_al, check_one;
	scanf("%s", S);
	len = strlen(S);
	count_al = 0;
	for(i=0; i<len; i++){
		if(alpha[S[i]-'a']==0) count_al++;
		alpha[S[i]-'a']++;
	}
	if (count_al<=1){
		printf("No\n");
	} else if(count_al==2){
		check_one=0;
		for(i=0; i<26; i++)
			if(alpha[i]==1) check_one=1;
		if(check_one==1) printf("No\n");
		else printf("Yes\n");
	} else {
		printf("Yes\n");
	}
   return 0;
}


#include <stdio.h>
#include <string.h>
char S[100005];
int alpha[26]={0};
int main(int argc, char *argv[]){
	int i, len, count_al, check_one;
	scanf("%s", S);
	len = strlen(S);
	count_al = 0;
	for(i=0; i<len; i++){
		if(alpha[S[i]-'a']==0) count_al++;
		alpha[S[i]-'a']++;
	}
	if(len==2){
		printf("Yes\n");
	} else if (count_al<=1){
		printf("No\n");
	} else if(count_al==2){
		check_one=0;
		for(i=0; i<26; i++)
			if(alpha[i]==1) check_one=1;
		if(check_one==1) printf("No\n");
		else printf("Yes\n");
	} else {
		printf("Yes\n");
	}
   return 0;
}


#include <stdio.h>
#include <string.h>
char S[100001];
int alpha[26]={0};
int main(int argc, char *argv[]){
	int i, len, count_al, check_one;
	scanf("%s", S);
	len = strlen(S);
	count_al=0;
	for(i=0; i<len; i++){
		if(alpha[S[i]-'a']==0) count_al++;
		alpha[S[i]-'a']++;
	}
	if(len<4){
		printf("No\n");
	} else if(count_al==2){
		check_one=0;
		for(i=0; i<26; i++)
			if(alpha[i]==1) check_one=1;
		if(check_one==1) printf("No\n");
		else printf("Yes\n");
	} else {
		printf("Yes\n");
	}
   return 0;
}


#include <stdio.h>
#include <string.h>
char S[100005];
int alpha[26]={0};
int main(int argc, char *argv[]){
	int i, len, count_al, check_one;
	scanf("%s", S);
	len = strlen(S);
	count_al = 0;
	for(i=0; i<len; i++){
		if((alpha[S[i]-'a']++)==0) count_al++;
	}
	if(len<4){
		printf("No\n");
	} else if (count_al<=1){
		printf("No\n");
	} else if(count_al==2){
		check_one=0;
		for(i=0; i<26; i++)
			if(alpha[i]==1) check_one=1;
		if(check_one==1) printf("No\n");
		else printf("Yes\n");
	} else {
		printf("Yes\n");
	}
   return 0;
}


#include <stdio.h>
#include <string.h>
char S[10001];
int alpha[26]={0};
int main(int argc, char *argv[]){
	int i, len, count_al, check_one;
	scanf("%s", S);
	len = strlen(S);
	count_al=0;
	for(i=0; i<len; i++){
		if(alpha[S[i]-'a']==0) count_al++;
		alpha[S[i]-'a']++;
	}
	if(count_al==2){
		check_one=0;
		for(i=0; i<26; i++)
			if(alpha[i]==1) check_one=1;
		if(check_one==1) printf("No\n");
		else printf("Yes\n");
	} else {
		printf("Yes\n");
	}
   return 0;
}


#include <stdio.h>
#include <string.h>
char S[10001];
int alpha[26]={0};
int main(int argc, char *argv[]){
	int i, len, count_al, check_one;
	scanf("%s", S);
	len = strlen(S);
	count_al=0;
	for(i=0; i<len; i++){
		if(alpha[S[i]-'a']==0) count_al++;
		alpha[S[i]-'a']++;
	}
	if(count_al==1){
		printf("No\n");
	} else if(count_al==2){
		check_one=0;
		for(i=0; i<26; i++)
			if(alpha[i]==1) check_one=1;
		if(check_one==1) printf("No\n");
		else printf("Yes\n");
	} else {
		printf("Yes\n");
	}
   return 0;
}


#include<iostream>
#include<iomanip>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<algorithm>
#include<queue>
#include<vector>
#include<queue>
#include<unordered_map>
using namespace std;
typedef long long ll;
typedef pair<int, int>pii;
const int inf = 0x7fffffff;
int a[27];
int main()
{
	//freopen("C:\\Users\\aerfa\\Desktop\\input.txt", "r", stdin);
	//freopen("C:\\Users\\aerfa\\Desktop\\output.txt", "w", stdout);

	string s;
	cin >> s;
	for (int i = 0; i < (signed)s.size(); i++) {
		a[s[i] - 'a']++;
	}
	int cnt = 0;
	bool flag = 0;
	bool flag2 = 0;
	for (int i = 0; i < 26; i++) {
		if (a[i])cnt++;
		if (a[i] > 1)flag = 1;
		if (a[i] == 1)flag2 = 1;
	}
	if ((cnt == 2&&!flag2) || (flag && cnt > 2)) {
		cout << "Yes" << endl;
	}
	else cout << "No" << endl;
	return 0;
}


#include<iostream>
#include<iomanip>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<algorithm>
#include<queue>
#include<vector>
#include<queue>
#include<unordered_map>
using namespace std;
typedef long long ll;
typedef pair<int, int>pii;
const int inf = 0x7fffffff;
int a[27];
int main()
{
	//freopen("C:\\Users\\aerfa\\Desktop\\input.txt", "r", stdin);
	//freopen("C:\\Users\\aerfa\\Desktop\\output.txt", "w", stdout);

	string s;
	cin >> s;
	for (int i = 0; i < (signed)s.size(); i++) {
		a[s[i] - 'a']++;
	}
	int cnt = 0;
	bool flag = 0;
	for (int i = 0; i < 26; i++) {
		if (a[i])cnt++;
		if (a[i] > 1)flag = 1;
	}
	if (cnt == 2 || (flag && cnt > 1)) {
		cout << "Yes" << endl;
	}
	else cout << "No" << endl;
	return 0;
}


#include<iostream>
#include<iomanip>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<algorithm>
#include<queue>
#include<vector>
#include<queue>
#include<unordered_map>
using namespace std;
typedef long long ll;
typedef pair<int, int>pii;
const int inf = 0x7fffffff;
int a[27];
int main()
{
	//freopen("C:\\Users\\aerfa\\Desktop\\input.txt", "r", stdin);
	//freopen("C:\\Users\\aerfa\\Desktop\\output.txt", "w", stdout);

	string s;
	cin >> s;
	for (int i = 0; i < (signed)s.size(); i++) {
		a[s[i] - 'a']++;
	}
	int cnt = 0;
	bool flag = 0;
	bool flag2 = 0;
	for (int i = 0; i < 26; i++) {
		if (a[i])cnt++;
		if (a[i] > 1)flag = 1;
		if (a[i] == 1)flag2 = 1;
	}
	if ((cnt == 2&&!flag2) || (flag && cnt > 1)) {
		cout << "Yes" << endl;
	}
	else cout << "No" << endl;
	return 0;
}


#include<iostream>
#include<iomanip>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<algorithm>
#include<queue>
#include<vector>
#include<queue>
#include<unordered_map>
using namespace std;
typedef long long ll;
typedef pair<int, int>pii;
const int inf = 0x7fffffff;
int a[27];
int main()
{
	//freopen("C:\\Users\\aerfa\\Desktop\\input.txt", "r", stdin);
	//freopen("C:\\Users\\aerfa\\Desktop\\output.txt", "w", stdout);

	string s;
	cin >> s;
	for (int i = 0; i < (signed)s.size(); i++) {
		a[s[i] - 'a']++;
	}
	int cnt = 0;
	bool flag = 0;
	bool flag2 = 0;
	for (int i = 0; i < 26; i++) {
		if (a[i])cnt++;
		if (a[i] > 1)flag = 1;
		if (a[i] == 1)flag2 = 1;
	}
	if (s.size() < 4||cnt>4||cnt==1)cout << "No" << endl;
	else {
		if(cnt==2&&flag2)cout << "No" << endl;
		else cout << "Yes" << endl;
	}
	return 0;
}


#include<iostream>
#include<iomanip>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<algorithm>
#include<queue>
#include<vector>
#include<queue>
#include<unordered_map>
using namespace std;
typedef long long ll;
typedef pair<int, int>pii;
const int inf = 0x7fffffff;
int a[27];
int main()
{
	//freopen("C:\\Users\\aerfa\\Desktop\\input.txt", "r", stdin);
	//freopen("C:\\Users\\aerfa\\Desktop\\output.txt", "w", stdout);

	string s;
	cin >> s;
	for (int i = 0; i < (signed)s.size(); i++) {
		a[s[i] - 'a']++;
	}
	int cnt = 0;
	bool flag = 0;
	bool flag2 = 0;
	for (int i = 0; i < 26; i++) {
		if (a[i])cnt++;
		if (a[i] > 1)flag = 1;
		if (a[i] == 1)flag2 = 1;
	}
	if (s.size() < 4||cnt>4||cnt==1)cout << "No" << endl;
	else {
		if(cnt==2&&flag2)cout << "No" << endl;
		cout << "Yes" << endl;
	}
	return 0;
}


/* I WILL BE YOURS, WILL U ACCEPT ME? */
/* I SHALL COPY PASTE ANY PART OF MY CODE BUT SHALL REVISE && REVISE */
   /* I SHALL WRITE IT DOWN BEFORE WRITTING IT */
      /* I SHALL UNDERSTAND AND THINK THOSE INPUTS */
         /* WELL, INPUT IS << 0 ? */
#include<bits/stdc++.h>
#include<cstring>
using namespace std;
#define nl printf("\n")
#define case(a,b) printf("Case %I64d: %I64d\n",a,b)
#define P(a) printf("%I64d\n",a)
#define SP(a) printf("%I64d ",a)
#define G(a) scanf("%I64d",&a)
#define GG(a,b) scanf("%I64d %I64d",&a,&b)
#define pb push_back
#define DB printf("I WAS HERE\n")
#define LL long long
#define zero 0

int main()
{
    string s;
    cin>>s;
    LL i;
    LL ar[30]={0};
    LL cnt=0;
    for(i=0;i<s.size();i++)
    {
        ar[s[i]-'a']++;
    }
    for(i=0;i<26;i++)
    {
        if(ar[i]>0)
            cnt++;
    }

    bool flag=false;

    if(cnt>2 && cnt %2==0)
        flag=true;

    else if(cnt>2 && cnt%2==1)
    {
        for(i=0;i<26;i++)
        {
            if(ar[i]>1)
            {
                flag=true;
                break;
            }
        }
    }

   else if(cnt==2)
    {
        flag=true;
        for(i=0;i<26;i++)
        {
            if(ar[i]==1)
            {
                flag=false;
            }
        }
    }
    if(flag==true)
        cout<<"Yes";
    else
        cout<<"No";
    nl;

   return 0;
}


/* I WILL BE YOURS, WILL U ACCEPT ME? */
/* I SHALL COPY PASTE ANY PART OF MY CODE BUT SHALL REVISE && REVISE */
   /* I SHALL WRITE IT DOWN BEFORE WRITTING IT */
      /* I SHALL UNDERSTAND AND THINK THOSE INPUTS */
         /* WELL, INPUT IS << 0 ? */
#include<bits/stdc++.h>
#include<cstring>
using namespace std;
#define nl printf("\n")
#define case(a,b) printf("Case %I64d: %I64d\n",a,b)
#define P(a) printf("%I64d\n",a)
#define SP(a) printf("%I64d ",a)
#define G(a) scanf("%I64d",&a)
#define GG(a,b) scanf("%I64d %I64d",&a,&b)
#define pb push_back
#define DB printf("I WAS HERE\n")
#define LL long long
#define zero 0

int main()
{
    string s;
    cin>>s;
    LL i;
    LL ar[30]={0};
    LL cnt=0;
    for(i=0;i<s.size();i++)
    {
        ar[s[i]-'a']++;
    }
    for(i=0;i<26;i++)
    {
        if(ar[i]>0)
            cnt++;
    }

    bool flag=false;

if(cnt>4)
    flag=false;
    else if(cnt>2 && cnt %2==0)
        flag=true;

    else if(cnt>2 && cnt%2==1)
    {
        for(i=0;i<26;i++)
        {
            if(ar[i]>1)
            {
                flag=true;
                break;
            }
        }
    }

   else if(cnt==2)
    {
        flag=true;
        for(i=0;i<26;i++)
        {
            if(ar[i]==1)
            {
                flag=false;
            }
        }
    }
    if(flag==true)
        cout<<"Yes";
    else
        cout<<"No";
    nl;

   return 0;
}


/* I WILL BE YOURS, WILL U ACCEPT ME? */
/* I SHALL COPY PASTE ANY PART OF MY CODE BUT SHALL REVISE && REVISE */
   /* I SHALL WRITE IT DOWN BEFORE WRITTING IT */
      /* I SHALL UNDERSTAND AND THINK THOSE INPUTS */
         /* WELL, INPUT IS << 0 ? */
#include<bits/stdc++.h>
#include<cstring>
using namespace std;
#define nl printf("\n")
#define case(a,b) printf("Case %I64d: %I64d\n",a,b)
#define P(a) printf("%I64d\n",a)
#define SP(a) printf("%I64d ",a)
#define G(a) scanf("%I64d",&a)
#define GG(a,b) scanf("%I64d %I64d",&a,&b)
#define pb push_back
#define DB printf("I WAS HERE\n")
#define LL long long
#define zero 0

int main()
{
    string s;
    cin>>s;
    LL i;
    LL ar[30]={0};
    LL cnt=0;
    for(i=0;i<s.size();i++)
    {
        ar[s[i]-'a']++;
    }
    for(i=0;i<26;i++)
    {
        if(ar[i]>0)
            cnt++;
    }

    bool flag=false;

    if(cnt>2 && cnt %2==0)
        flag=true;

    else if(cnt>2 && cnt%2==1)
    {
        for(i=0;i<26;i++)
        {
            if(ar[i]>1)
            {
                flag=true;
                break;
            }
        }
    }

   else if(cnt==2)
    {

        flag=true;

            LL add=0;
            for(i=1;i<s.size();i++)
            {
                if(s[i-1]!=s[i])
                    add++;
            }

            if(add==1)
                flag=false;
        }

    if(flag==true)
        cout<<"Yes";
    else
        cout<<"No";
    nl;

   return 0;
}


/* I WILL BE YOURS, WILL U ACCEPT ME? */
/* I SHALL COPY PASTE ANY PART OF MY CODE BUT SHALL REVISE && REVISE */
   /* I SHALL WRITE IT DOWN BEFORE WRITTING IT */
      /* I SHALL UNDERSTAND AND THINK THOSE INPUTS */
         /* WELL, INPUT IS << 0 ? */
#include<bits/stdc++.h>
#include<cstring>
using namespace std;
#define nl printf("\n")
#define case(a,b) printf("Case %I64d: %I64d\n",a,b)
#define P(a) printf("%I64d\n",a)
#define SP(a) printf("%I64d ",a)
#define G(a) scanf("%I64d",&a)
#define GG(a,b) scanf("%I64d %I64d",&a,&b)
#define pb push_back
#define DB printf("I WAS HERE\n")
#define LL long long
#define zero 0

int main()
{
    string s;
    cin>>s;
    LL i;
    LL ar[30]={0};
    LL cnt=0;
    for(i=0;i<s.size();i++)
    {
        ar[s[i]-'a']++;
    }
    for(i=0;i<26;i++)
    {
        if(ar[i]>0)
            cnt++;
    }

    bool flag=false;

    if(cnt>2 && cnt %2==0)
        flag=true;

    else if(cnt>2 && cnt%2==1)
    {
        for(i=0;i<26;i++)
        {
            if(ar[i]>1)
            {
                flag=true;
                break;
            }
        }
    }

   else if(cnt==2)
    {
        LL val=0;
        flag=true;
        for(i=0;i<26;i++)
        {
            if(ar[i]==1)
            {
                val++;
            }
        }
        if(val==1)
            flag=false;
    }
    if(flag==true)
        cout<<"Yes";
    else
        cout<<"No";
    nl;

   return 0;
}


#include<bits/stdc++.h>
#define INF 0x3f3f3f3f
#define LL long long
#define ULL unsigned long long
#define bug(x) cout<<"bug-----"<<x<<endl
#define R(i,n) for(int i = 0; i < n; i++)
using namespace std;
const int mod= 1e9+7;
const int maxn = 1e6 +10;
int a[26];
int b[3];
int main(){
    //freopen("C:\\Users\\admin\\Desktop\\1.in","r",stdin);
    //freopen("C:\\Users\\admin\\Desktop\\1.out","w",stdout);
    char s[maxn];
    cin>>s;
    int l=strlen(s),flag=0;
    for(int i=0;i<l;i++)
    {
        int t=s[i]-'a';
        if(a[t]==0)
        {
            flag++;
        }
        a[t]++;
    }
    if(flag>4||flag==1)
    {
        cout<<"No"<<endl;
        return 0;
    }
    else
    {
        int j=0;
        for(int i=0;i<26;i++)
        {
            if(a[i]!=0)
            {
                b[j++]=a[i];
            }
        }
        sort(b,b+j);
        if(j==2)
        {
            if(b[0]==1)
            {
                cout<<"No"<<endl;
                return 0;
            }
        }
        else if(j==3)
        {
            if(b[0]!=1||b[2]==1)
            {
                cout<<"No"<<endl;
                return 0;
            }
        }
    }
    cout<<"Yes"<<endl;

    return 0;
}


#include<bits/stdc++.h>
#define INF 0x3f3f3f3f
#define LL long long
#define ULL unsigned long long
#define bug(x) cout<<"bug-----"<<x<<endl
#define R(i,n) for(int i = 0; i < n; i++)
using namespace std;
const int mod= 1e9+7;
const int maxn = 1e6 +10;
int a[26];
int b[3];
int main(){
    //freopen("C:\\Users\\admin\\Desktop\\1.in","r",stdin);
    //freopen("C:\\Users\\admin\\Desktop\\1.out","w",stdout);
    char s[maxn];
    cin>>s;
    int l=strlen(s),flag=0;
    for(int i=0;i<l;i++)
    {
        int t=s[i]-'a';
        if(a[t]==0)
        {
            flag++;
        }
        a[t]++;
    }
    if(flag>4||flag==1)
    {
        cout<<"No"<<endl;
        return 0;
    }
    else
    {
        int j=0;
        for(int i=0;i<26;i++)
        {
            if(a[i]!=0)
            {
                b[j++]=a[i];
            }
        }
        sort(b,b+j);
        if(j==2)
        {
            if(b[0]==1)
            {
                cout<<"No"<<endl;
                return 0;
            }
        }
        else if(j==3)
        {
            if(b[2]<2)
            {
                cout<<"No"<<endl;
                return 0;
            }
        }
    }
    cout<<"Yes"<<endl;

    return 0;
}


#include<bits/stdc++.h>
#define INF 0x3f3f3f3f
#define LL long long
#define ULL unsigned long long
#define bug(x) cout<<"bug-----"<<x<<endl
#define R(i,n) for(int i = 0; i < n; i++)
using namespace std;
const int mod= 1e9+7;
const int maxn = 1e6 +10;
int a[26];
int b[3];
int main(){
    //freopen("C:\\Users\\admin\\Desktop\\1.in","r",stdin);
    //freopen("C:\\Users\\admin\\Desktop\\1.out","w",stdout);
    char s[maxn];
    cin>>s;
    int l=strlen(s),flag=0;
    for(int i=0;i<l;i++)
    {
        int t=s[i]-'a';
        if(a[t]==0)
        {
            flag++;
        }
        a[t]++;
    }
    if(flag>4||flag==1)
    {
        cout<<"No"<<endl;
        return 0;
    }
    else
    {
        int j=0;
        for(int i=0;i<26;i++)
        {
            if(a[i]!=0)
            {
                b[j++]=a[i];
            }
        }
        sort(b,b+j);
        if(j==2)
        {
            if(b[0]==1)
            {
                cout<<"No"<<endl;
                return 0;
            }
        }
        else if(j==3)
        {
            if(b[0]!=1)
            {
                cout<<"No"<<endl;
                return 0;
            }
        }
    }
    cout<<"Yes"<<endl;

    return 0;
}


#include<bits/stdc++.h>
#define INF 0x3f3f3f3f
#define LL long long
#define ULL unsigned long long
#define bug(x) cout<<"bug-----"<<x<<endl
#define R(i,n) for(int i = 0; i < n; i++)
using namespace std;
const int mod= 1e9+7;
const int maxn = 1e6 +10;
int a[26];
int b[3];
int main(){
    //freopen("C:\\Users\\admin\\Desktop\\1.in","r",stdin);
    //freopen("C:\\Users\\admin\\Desktop\\1.out","w",stdout);
    char s[maxn];
    cin>>s;
    int l=strlen(s),flag=0;
    for(int i=0;i<l;i++)
    {
        int t=s[i]-'a';
        if(a[t]!=0)
        {
            flag++;
        }
        a[t]++;
    }
    if(flag>4||flag==1)
    {
        cout<<"No"<<endl;
        return 0;
    }
    else
    {
        int j=0;
        for(int i=0;i<26;i++)
        {
            if(a[i]!=0)
            {
                b[j++]=a[i];
            }
        }
        sort(b,b+j);
        if(j==2)
        {
            if(b[0]==1)
            {
                cout<<"No"<<endl;
                return 0;
            }
        }
        else
        {
            if(b[0]!=1)
            {
                cout<<"No"<<endl;
                return 0;
            }
        }
    }
    cout<<"Yes"<<endl;

    return 0;
}


#include<bits/stdc++.h>
#define INF 0x3f3f3f3f
#define LL long long
#define ULL unsigned long long
#define bug(x) cout<<"bug-----"<<x<<endl
#define R(i,n) for(int i = 0; i < n; i++)
using namespace std;
const int mod= 1e9+7;
const int maxn = 1e6 +10;
int a[26];
int b[3];
int main(){
    //freopen("C:\\Users\\admin\\Desktop\\1.in","r",stdin);
    //freopen("C:\\Users\\admin\\Desktop\\1.out","w",stdout);
    char s[maxn];
    cin>>s;
    int l=strlen(s),flag=0;
    for(int i=0;i<l;i++)
    {
        int t=s[i]-'a';
        if(a[t]==0)
        {
            flag++;
        }
        a[t]++;
    }
    if(flag>4||flag==1)
    {
        cout<<"No"<<endl;
        return 0;
    }
    else
    {
        int j=0;
        for(int i=0;i<26;i++)
        {
            if(a[i]!=0)
            {
                b[j++]=a[i];
            }
        }
        sort(b,b+j);
        if(j==2)
        {
            if(b[0]==1)
            {
                cout<<"No"<<endl;
                return 0;
            }
        }
        else
        {
            if(b[0]!=1)
            {
                cout<<"No"<<endl;
                return 0;
            }
        }
    }
    cout<<"Yes"<<endl;

    return 0;
}


#include<bits/stdc++.h>
#define INF 0x3f3f3f3f
#define LL long long
#define ULL unsigned long long
#define bug(x) cout<<"bug-----"<<x<<endl
#define R(i,n) for(int i = 0; i < n; i++)
using namespace std;
const int mod= 1e9+7;
const int maxn = 1e6 +10;
int a[26];
int b[3];
int main(){
    //freopen("C:\\Users\\admin\\Desktop\\1.in","r",stdin);
    //freopen("C:\\Users\\admin\\Desktop\\1.out","w",stdout);
    char s[maxn];
    cin>>s;
    int l=strlen(s),flag=0;
    for(int i=0;i<l;i++)
    {
        int t=s[i]-'a';
        if(a[t]!=0)
        {
            flag++;
        }
        a[t]++;
    }
    if(flag>4)
    {
        cout<<"No"<<endl;
        return 0;
    }
    else
    {
        int j=0;
        for(int i=0;i<26;i++)
        {
            if(a[i]!=0)
            {
                b[j++]=a[i];
            }
        }
        sort(b,b+j);
        if(j==2)
        {
            if(b[0]==1)
            {
                cout<<"No"<<endl;
                return 0;
            }
        }
        else
        {
            if(b[0]!=1)
            {
                cout<<"No"<<endl;
                return 0;
            }
        }
    }
    cout<<"Yes"<<endl;

    return 0;
}


#include<stdio.h>
#include<string.h>

int main()
{
    char s[100000];

    int x=0,c=0,count[26],flag = 0;

    scanf("%[^\n]%*c", s);

    while(s[c] != '\0')
    {
        if( s[c] >= 'a' && s[c] <= 'z' )
        {
            x = s[c] - 'a';
            count[x]++;
        }
        c++;
    }
    int num=0,numC=0;
    for (int c = 0; c < 26; c++)
    {
        if(count[c] > 0)
        {
            num++;
            if(count[c] == 1)
                numC++;

        }
    }

    if(num == 1)
    {
        printf("No");
    }
    if(num == 2)
    {
        if(numC == num)
        {
//         printf("%d",numC);
            printf("No");
        }
        else
            printf("Yes");
    }
    if(num == 3)
    {
        if(numC == 3)
            printf("No");
        else
            printf("Yes");
    }
    if(num == 4)
    {
        if(numC == 4)
            printf("Yes");
        else
            printf("No");
    }
    if(num > 4)
    {
        printf("No");
    }
    return 0;
}


#include<stdio.h>
#include<string.h>

int main()
{
    char s[100000];

    int x=0,c=0,count[26],flag = 0;

    //scanf("%[^\n]%*c", s);
scanf("%s",s);
    while(s[c] != '\0')
    {
        if( s[c] >= 'a' && s[c] <= 'z' )
        {
            x = s[c] - 'a';
            count[x]++;
        }
        c++;
    }
    int num=0,numC=0;
    for (int c = 0; c < 26; c++)
    {
        if(count[c] > 0)
        {
            num++;
            if(count[c] == 1)
                numC++;

        }
    }

    if(num == 1)
    {
        printf("No");
    }
    if(num == 2)
    {
        if(numC)
        {
            printf("No");
        }
        else
            printf("Yes");
    }
    if(num == 3)
    {
        if(numC == 3)
            printf("No");
        else
            printf("Yes");
    }
    if(num == 4)
    {
    	printf("Yes");
    }
    if(num > 4)
    {
        printf("No");
    }
    return 0;
}


#include<stdio.h>
#include<string.h>

int main()
{
    char s[100000];

    int x=0,c=0,count[26],flag = 0;

    scanf("%[^\n]%*c", s);

    while(s[c] != '\0')
    {
        if( s[c] >= 'a' && s[c] <= 'z' )
        {
            x = s[c] - 'a';
            count[x]++;
        }
        c++;
    }
    int num=0,numC=0;
    for (int c = 0; c < 26; c++)
    {
        if(count[c] > 0)
        {
            num++;
            if(count[c] == 1)
                numC++;

        }
    }

    if(num == 1)
    {
        printf("No");
    }
    if(num == 2)
    {
//             printf("%d",numC);
        if(numC >= 1)
        {
            printf("No");
        }
        else
            printf("Yes");
    }
    if(num == 3)
    {
        if(numC == 3)
            printf("No");
        else
            printf("Yes");
    }
    if(num == 4)
    {
    	printf("Yes");
    }
    if(num > 4)
    {
        printf("No");
    }
    return 0;
}


#include<stdio.h>
#include<string.h>

int main()
{
    char s[100000];

    int x=0,c=0,count[26],flag = 0;

    scanf("%[^\n]%*c", s);

    while(s[c] != '\0')
    {
        if( s[c] >= 'a' && s[c] <= 'z' )
        {
            x = s[c] - 'a';
            count[x]++;
        }
        c++;
    }
    int num=0,numC=0;
    for (int c = 0; c < 26; c++)
    {
        if(count[c] > 0)
        {
            num++;
            if(count[c] == 1)
                numC++;

        }
    }

    if(num == 1)
    {
        printf("No");
    }
    if(num == 2)
    {
//             printf("%d",numC);
        if(numC >= 1)
        {
            printf("No");
        }
        else
            printf("Yes");
    }
    if(num == 3)
    {
        if(numC == 3)
            printf("No");
        else
            printf("Yes");
    }
    if(num == 4)
    {
        if(numC == 4)
            printf("Yes");
        else
            printf("No");
    }
    if(num > 4)
    {
        printf("No");
    }
    return 0;
}


#include<stdio.h>
#include<string.h>

int main()
{
    char s[100000];

    int x,c,count[26],flag = 0;

    scanf("%s",s);

    while(s[c] != '\0')
    {
        if( s[c] >= 'a' && s[c] <= 'z' )
        {
            x = s[c] - 'a';
            count[x]++;
        }
        c++;
    }
    int num,numC,numY;
    for (int c = 0; c < 26; c++)
    {
        if(count[c] > 0)
        {
            num++;
            if(count[c] == 1)
                numC++;
            if(count[c] > 1)
                numY++;
        }
    }

    if(num == 1)
    {
        printf("No");
    }
    if(num == 2)
    {
        if(numC)
            printf("No");
        else
            printf("Yes");
    }
    if(num == 3)
    {
        if(num == numC)
            printf("No");
        else
            printf("Yes");
    }
    if(num == 4)
    {
        if(numC == num)
            printf("Yes");
        else
            printf("No");
    }
    if(num > 4)
    {
        printf("No");
    }
    return 0;
}


#include <cstdio>
#include <cmath>
#include <iostream>
#include <set>
#include <vector>
#include <sstream>
#include <string.h>
#include <math.h>
#include <map>
#include <list>

using namespace std;

char s[100010];
int charC[200]={0};
int uniqC=0;

int main(){

    scanf("%s",s);
    int i;
    for(i=0;i< strlen(s);i++){
        charC[(s[i])]++;
        if(charC[(s[i])]==1)
            uniqC++;

    }

    if(uniqC>4){
        printf("No");
        return 0;
    }

    if(uniqC==2){
        for (i = 0; i<200; i++)
        {
            if(charC[i] > 0 && charC[i]<2){
                printf("No");
                return 0;
            }
        }
        printf("Yes");
        return 0;
    }
    else if(uniqC==3){

        int ctr=0;
        for (i = 0; i<200; i++)
        {
            if(charC[i] > 0 && charC[i]<2){
                ctr++;
            }
            if(ctr>2){
                printf("No");
                return 0;
            }
        }
        printf("Yes");
        return 0;

    }
    else if(uniqC==4){
        printf("Yes");
        return 0;

    }
    else{
        printf("No");
        return 0;

    }

    return 0;

}


#include <cstdio>
#include <cmath>
#include <iostream>
#include <set>
#include <vector>
#include <sstream>
#include <string.h>
#include <math.h>
#include <map>

using namespace std;

char s[100010];
int charC[200]={0};
set <char> chars;

int main(){

    cin>>s;
    int i;
    for(i=0;i< strlen(s);i++){
        charC[(s[i])]++;
        if(charC[(s[i])]==1)
            chars.insert((s[i]));
    }
    if(chars.size()==2){
        set<char>::iterator it;
        for (it = chars.begin(); it != chars.end(); ++it)
        {
            if(charC[*it]<2){
                cout<<"No";
                return 0;
            }
        }
        cout<<"Yes";
        return 0;
    }
    else if(chars.size()==3){
        set<char>::iterator it;
        int ctr=0;
        for (it = chars.begin(); it != chars.end(); ++it)
        {
            if(charC[*it]<2){
                ctr++;
            }
            if(ctr>2){
                cout<<"No";
                return 0;
            }
        }
        cout<<"Yes";
        return 0;

    }
    else if(chars.size()==4){
        cout<<"Yes";
        return 0;

    }
    else{
        cout<<"No";
        return 0;

    }

    return 0;

}


#include <cstdio>
#include <cmath>
#include <iostream>
#include <set>
#include <vector>
#include <sstream>
#include <string.h>
#include <math.h>
#include <map>

using namespace std;

char s[100010];
map <char, int> charC;
set <char> chars;

int main(){

    cin>>s;
    int i;
    for(i=0;i< strlen(s);i++){
        charC[(s[i])]++;
        chars.insert((s[i]));
    }
    if(chars.size()==2){
        set<char>::iterator it;
        for (it = chars.begin(); it != chars.end(); ++it)
        {
            if(charC[*it]<2){
                cout<<"No";
                return 0;
            }
        }
        cout<<"Yes";
        return 0;
    }
    else if(chars.size()==3){
        set<char>::iterator it;
        int ctr=0;
        for (it = chars.begin(); it != chars.end(); ++it)
        {
            if(charC[*it]<2){
                ctr++;
            }
            if(ctr>2){
                cout<<"No";
                return 0;
            }
        }
        cout<<"Yes";
        return 0;

    }
    else if(chars.size()==4){
        cout<<"Yes";
        return 0;

    }
    else{
        cout<<"No";
        return 0;

    }

    return 0;

}


#include <cstdio>
#include <cmath>
#include <iostream>
#include <set>
#include <vector>
#include <sstream>
#include <string.h>
#include <math.h>
#include <map>

using namespace std;

char s[100010];
int charC[200]={0};
set<char> chars;

int main(){

    scanf("%s",s);
    int i;
    for(i=0;i< strlen(s);i++){
        charC[(s[i])]++;
    }

    for(i=0;i< 200;i++) {
        if(charC[(s[i])]>0)
            chars.insert((s[i]));
    }

    if(chars.size()==2){
        set<char>::iterator it;
        for (it = chars.begin(); it != chars.end(); ++it)
        {
            if(charC[*it]<2){
                cout<<"No";
                return 0;
            }
        }
        cout<<"Yes";
        return 0;
    }
    else if(chars.size()==3){
        set<char>::iterator it;
        int ctr=0;
        for (it = chars.begin(); it != chars.end(); ++it)
        {
            if(charC[*it]<2){
                ctr++;
            }
            if(ctr>2){
                cout<<"No";
                return 0;
            }
        }
        cout<<"Yes";
        return 0;

    }
    else if(chars.size()==4){
        cout<<"Yes";
        return 0;

    }
    else{
        cout<<"No";
        return 0;

    }

    return 0;

}


#include <cstdio>
#include <cmath>
#include <iostream>
#include <set>
#include <vector>
#include <sstream>
#include <string.h>
#include <math.h>
#include <map>

using namespace std;

char s[100010];
int charC[200]={0};
set <char> chars;

int main(){

    cin>>s;
    int i;
    for(i=0;i< strlen(s);i++){
        charC[(s[i])]++;
        chars.insert((s[i]));
    }
    if(chars.size()==2){
        set<char>::iterator it;
        for (it = chars.begin(); it != chars.end(); ++it)
        {
            if(charC[*it]<2){
                cout<<"No";
                return 0;
            }
        }
        cout<<"Yes";
        return 0;
    }
    else if(chars.size()==3){
        set<char>::iterator it;
        int ctr=0;
        for (it = chars.begin(); it != chars.end(); ++it)
        {
            if(charC[*it]<2){
                ctr++;
            }
            if(ctr>2){
                cout<<"No";
                return 0;
            }
        }
        cout<<"Yes";
        return 0;

    }
    else if(chars.size()==4){
        cout<<"Yes";
        return 0;

    }
    else{
        cout<<"No";
        return 0;

    }

    return 0;

}


#include <cstdio>
#include <cmath>
#include <iostream>
#include <set>
#include <vector>
#include <sstream>
#include <string.h>
#include <math.h>
#include <map>

using namespace std;

char s[100010];
int charC[200]={0};
set<char> chars;
int uniqC=0;

int main(){

    scanf("%s",s);
    int i;
    for(i=0;i< strlen(s);i++){
        charC[(s[i])]++;

        if(charC[(s[i])]==1)
            uniqC++;

        if(uniqC>4)
            break;
    }

    if(uniqC>4){
        cout<<"No";
        return 0;
    }

    for(i=0;i< 200;i++) {
        if(charC[(s[i])]>0)
            chars.insert((s[i]));
    }

    if(chars.size()==2){
        set<char>::iterator it;
        for (it = chars.begin(); it != chars.end(); ++it)
        {
            if(charC[*it]<2){
                cout<<"No";
                return 0;
            }
        }
        cout<<"Yes";
        return 0;
    }
    else if(chars.size()==3){
        set<char>::iterator it;
        int ctr=0;
        for (it = chars.begin(); it != chars.end(); ++it)
        {
            if(charC[*it]<2){
                ctr++;
            }
            if(ctr>2){
                cout<<"No";
                return 0;
            }
        }
        cout<<"Yes";
        return 0;

    }
    else if(chars.size()==4){
        cout<<"Yes";
        return 0;

    }
    else{
        cout<<"No";
        return 0;

    }

    return 0;

}


#include <cstdio>
#include <cmath>
#include <iostream>
#include <set>
#include <vector>
#include <sstream>
#include <string.h>
#include <math.h>
#include <map>
#include <list>

using namespace std;

char s[100010];
int charC[200]={0};
list<char> chars;
int uniqC=0;

int main(){

    scanf("%s",s);
    int i;
    for(i=0;i< strlen(s);i++){
        charC[(s[i])]++;

        if(charC[(s[i])]==1)
            uniqC++;

        if(uniqC>4)
            break;
    }

    if(uniqC>4){
        cout<<"No";
        return 0;
    }

    for(i=0;i< 200;i++) {
        if(charC[(s[i])]>0)
            chars.push_back((s[i]));
    }

    if(uniqC==2){
        list<char>::iterator it;
        for (it = chars.begin(); it != chars.end(); ++it)
        {
            if(charC[*it]<2){
                cout<<"No";
                return 0;
            }
        }
        cout<<"Yes";
        return 0;
    }
    else if(uniqC==3){
        list<char>::iterator it;
        int ctr=0;
        for (it = chars.begin(); it != chars.end(); ++it)
        {
            if(charC[*it]<2){
                ctr++;
            }
            if(ctr>2){
                cout<<"No";
                return 0;
            }
        }
        cout<<"Yes";
        return 0;

    }
    else if(uniqC==4){
        cout<<"Yes";
        return 0;

    }
    else{
        cout<<"No";
        return 0;

    }

    return 0;

}