#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:66777216")
using namespace std;
int a, b, c, d, i, j, n, m, k;
char s1[200002], s2[200002];
int pr[200002], sf[200002];
int pf[200002][26];
int main() {
  scanf("%s%s", s1, s2);
  n = (int)strlen(s1);
  m = (int)strlen(s2);
  for (int _n((n)-1), i(0); i <= _n; i++) {
    if (i) pr[i] = pr[i - 1];
    if (pr[i] < m && s1[i] == s2[pr[i]]) ++pr[i];
  }
  memset(pf, -1, sizeof(pf));
  for (int _n((m)-1), i(0); i <= _n; i++) {
    if (i) memcpy(pf[i], pf[i - 1], 26 * sizeof(int));
    pf[i][s2[i] - 'a'] = i;
  }
  for (int i = (n - 1), _b = (0); i >= _b; i--) {
    if (i != n - 1) sf[i] = sf[i + 1];
    if (sf[i] < m && s1[i] == s2[m - sf[i] - 1]) ++sf[i];
  }
  for (int _n((n)-1), i(0); i <= _n; i++) {
    int pos = 0;
    if (pr[i] == 0)
      pos = -1;
    else
      pos = pf[pr[i] - 1][s1[i] - 'a'];
    if (pos == -1 || pos + 1 + sf[i + 1] < m) {
      printf("No\n");
      exit(0);
    }
  }
  printf("Yes\n");
}
