#include <bits/stdc++.h>
using namespace std;
char s[200001], t[200001];
int l[200000], r[200000];
int main() {
  scanf("%s%s", s, t);
  int n = strlen(s), m = strlen(t);
  int p[26] = {};
  memset(p, -1, sizeof(p));
  for (int i = 0, j = 0; i < n; ++i)
    if (s[i] == t[j])
      l[i] = p[s[i] - 'a'] = ++j;
    else {
      if (p[s[i] - 'a'] == -1) p[s[i] - 'a'] = 0;
      l[i] = p[s[i] - 'a'];
    }
  memset(p, -1, sizeof(p));
  for (int i = n - 1, j = m - 1; i >= 0; --i)
    if (s[i] == t[j])
      r[i] = p[s[i] - 'a'] = m - j--;
    else {
      if (p[s[i] - 'a'] == -1) p[s[i] - 'a'] = 0;
      r[i] = p[s[i] - 'a'];
    }
  for (int i = 0; i < n; ++i)
    if (l[i] + r[i] - 1 < m) {
      printf("No\n");
      return 0;
    }
  printf("Yes\n");
  return 0;
}
