#include <bits/stdc++.h>
using namespace std;
const long long MAX = 5 + 3e5;
const long long K = 26;
int N, M, L[MAX], R[MAX];
string S, T;
long long last[K];
int main() {
  cin >> S >> T;
  N = S.size();
  M = T.size();
  bool ok = N >= M;
  for (int i = 0; i < K; i++) last[i] = -1;
  for (int i = 0, j = 0; i < N; i++) {
    if (j < M && S[i] == T[j]) last[S[i] - 'a'] = j, j++;
    L[i] = last[S[i] - 'a'];
  }
  for (int i = 0; i < K; i++) last[i] = MAX;
  for (int i = N - 1, j = M - 1; i >= 0; i--) {
    if (j >= 0 && S[i] == T[j]) last[S[i] - 'a'] = j, j--;
    R[i] = last[S[i] - 'a'];
  }
  for (int i = 0; i < N; i++)
    if (L[i] < R[i]) ok = 0;
  cout << (ok ? "Yes" : "No") << endl;
  return 0;
}
