#include<bits/stdc++.h>
#define rep(i,a,b) for(int i=a;i<b;i++)
#define rrep(i,a,b) for(int i=a;i>=b;i--)
#define fore(i,a) for(auto &i:a)
#pragma GCC optimize ("-O3")
using namespace std; void _main(); int main() { cin.tie(0); ios::sync_with_stdio(false); _main(); }
//---------------------------------------------------------------------------------------------------
int getrand(int l, int r) { // [l, r]
    static uint32_t y = time(NULL);
    y ^= (y << 13); y ^= (y >> 17);
    y ^= (y << 5);
    return y % (r - l + 1) + l;
}
string makeString(int len, string type = "qwertyuiopasdfghjklzxcvbnm") {
    string res = "";
    rep(i, 0, len) res += type[getrand(0, type.size() - 1)];
    return res;
}
/*---------------------------------------------------------------------------------------------------
????????????????????????????????? ??§?????§  
??????????????? ??§?????§ ???????´<_??? ?????? Welcome to My Coding Space!
???????????? ??? ?´_???`??????/??? ???i     
?????????????????????????????? ???  |???|     
????????? /?????? /??£??£??£??£/??????|  
??? ???_(__??????/???    ???/ .| .|????????????  
??? ????????????/????????????/??????u??????  
---------------------------------------------------------------------------------------------------*/



string T, P;
int NT, NP;
//--------------------------------------------------------------------------------------------------
void _main() {
    cin >> T >> P;
    NT = T.length(), NP = P.length();

    int p = 0;
    deque<int> qu;
    rep(i, 0, NT) {
        if (T[i] == P[p]) {
            p++;
            qu.push_back(i);
            if (p == NP) break;
        }
    }
    if (p != NP) {
        printf("no\n");
        return;
    }

    p = NP - 1;
    rrep(i, NT - 1, 0) {
        if (T[i] == P[p]) {
            int pre = qu.back(); qu.pop_back();
            if (pre != i) {
                printf("no\n");
                return;
            }
            p--;
            if (p < 0) break;
        }
    }
    if (0 <= p) {
        printf("no\n");
        return;
    }

    printf("yes\n");
}