#include <bits/stdc++.h>
using namespace std;
const int M = 210000;
char s[M], t[M];
int ls, lt, l[M], r[M], pos[M];
int main() {
  gets(s);
  ls = strlen(s);
  gets(t);
  lt = strlen(t);
  int j = 0;
  memset(pos, -1, sizeof(pos));
  for (int i = 0; i < ls; ++i) {
    if (j < lt && s[i] == t[j]) pos[s[i] - 'a'] = j++;
    if (pos[s[i] - 'a'] != -1) l[i] = pos[s[i] - 'a'] + 1;
  }
  memset(pos, -1, sizeof(pos));
  j = lt - 1;
  for (int i = ls - 1; i >= 0; --i) {
    if (j >= 0 && s[i] == t[j]) pos[s[i] - 'a'] = j--;
    if (pos[s[i] - 'a'] != -1) r[i] = lt - pos[s[i] - 'a'];
  }
  int ok = 1;
  for (int i = 0; i < ls; ++i)
    if (l[i] + r[i] - 1 < lt) {
      ok = 0;
      break;
    }
  if (ok)
    puts("Yes");
  else
    puts("No");
  return 0;
}
