#include <bits/stdc++.h>
using namespace std;
const int maxn = 222222, qqq = (int)'z';
int j, n, i, m, f1[maxn], f2[maxn], ff[maxn][qqq + 4];
char s[maxn], t[maxn], tr[maxn];
map<char, int> mp, mpr;
inline bool ex(int l, int r, int c) {
  r = min(r, m), l = max(l, 1);
  return (ff[r][c] > ff[l - 1][c]);
}
int main() {
  scanf("%s", s + 1), scanf("%s", t + 1);
  n = strlen(s + 1), m = strlen(t + 1);
  for (i = 1; i <= m; ++i)
    if (mp[t[i]] == 0) mp[t[i]] = i;
  for (i = 1; i <= m; ++i) tr[m - i + 1] = t[i];
  for (i = 1; i <= m; ++i)
    if (mpr[tr[i]] == 0) mpr[tr[i]] = i;
  for (i = 1; i <= m; ++i) {
    for (j = (int)'a'; j <= (int)'z'; ++j) ff[i][j] = ff[i - 1][j];
    ++ff[i][(char)t[i]];
  }
  f1[0] = 0;
  for (i = 1; i <= n; ++i) {
    f1[i] = f1[i - 1];
    if (f1[i] == m) continue;
    if (s[i] == t[f1[i] + 1]) ++f1[i];
  }
  f2[n + 1] = 0;
  for (i = n; i >= 1; --i) {
    f2[i] = f2[i + 1];
    if (f2[i] == m) continue;
    if (s[i] == tr[f2[i] + 1]) ++f2[i];
  }
  for (i = 1; i <= n; ++i)
    if (!ex(m - f2[i + 1], f1[i - 1] + 1, (int)s[i])) {
      puts("No");
      return 0;
    }
  puts("Yes");
  return 0;
}
