#include <bits/stdc++.h>
using namespace std;
const int MAXN = 3e5;
int N;
char S[MAXN];
const int MAXM = 3e5;
int M;
char T[MAXM];
int loc[2][MAXM];
vector<pair<int, int>> cnds[26];
void oops() {
  cout << "No" << '\n';
  exit(0);
}
int main() {
  ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  cin >> S >> T;
  N = int(strlen(S));
  M = int(strlen(T));
  for (int z = 0; z < 2; z++) {
    loc[z][0] = 0;
    for (int i = 0, j = 0; j < M; i++, j++) {
      while (true) {
        if (i == N) {
          oops();
        }
        if (S[i] == T[j]) break;
        i++;
      }
      loc[z][j + 1] = i + 1;
    }
    reverse(S, S + N);
    reverse(T, T + M);
  }
  for (int j = 0; j < M; j++) {
    int c = T[j] - 'a';
    cnds[c].emplace_back(loc[0][j + 1] - 1, j + 1);
  }
  for (int i = 0; i < N; i++) {
    cerr << i << endl;
    int c = S[i] - 'a';
    auto it = upper_bound(cnds[c].begin(), cnds[c].end(), make_pair(i, N));
    if (it == cnds[c].begin()) {
      oops();
    }
    it = prev(it);
    if (loc[1][M - it->second] > N - 1 - i) {
      oops();
    }
  }
  cout << "Yes" << '\n';
  return 0;
}
