#include <bits/stdc++.h>
using namespace std;
char s1[500010], s2[500010];
int t[27], L[500010], R[500010];
int main() {
  scanf("%s%s", s1 + 1, s2 + 1);
  int len1 = strlen(s1 + 1);
  int len2 = strlen(s2 + 1);
  int j = 1;
  memset(t, -1, sizeof(t));
  for (int i = 1; i <= len1; i++) {
    if (j <= len2 && s1[i] == s2[j]) t[s1[i] - 'a'] = j++;
    R[i] = t[s1[i] - 'a'];
  }
  memset(t, -1, sizeof(t));
  j = len2;
  for (int i = len1; i; i--) {
    if (j && s1[i] == s2[j]) t[s1[i] - 'a'] = j--;
    L[i] = t[s1[i] - 'a'];
  }
  for (int i = 1; i <= len1; i++)
    if (L[i] == -1 || R[i] == -1 || R[i] < L[i]) return puts("No"), 0;
  return puts("Yes"), 0;
}
