#include <bits/stdc++.h>
using namespace std;
char s[200200], t[200200];
long long f[200200], g[200200], bf[200200][27];
int main() {
  scanf("%s %s", s + 1, t + 1);
  long long n = strlen(s + 1), m = strlen(t + 1);
  f[0] = 0;
  for (long long i = 1, j = 0; i <= n; i++) {
    if (s[i] == t[j + 1]) j++;
    f[i] = j;
  }
  g[n + 1] = m + 1;
  for (long long i = n, j = m + 1; i >= 1; i--) {
    if (s[i] == t[j - 1]) j--;
    g[i] = j;
  }
  for (long long j = 0; j < 26; j++) bf[0][j] = -1;
  for (long long i = 1; i <= m; i++) {
    for (long long j = 0; j < 26; j++) bf[i][j] = bf[i - 1][j];
    bf[i][t[i] - 'a'] = i;
  }
  for (long long j = 0; j < 26; j++) bf[m + 1][j] = bf[m][j];
  for (long long i = 1; i <= n; i++) {
    long long a = f[i - 1] + 1, b = g[i + 1] - 1;
    if (bf[a][s[i] - 'a'] < b) {
      cout << "No";
      return 0;
    }
  }
  cout << "Yes";
  return 0;
}
