#include <bits/stdc++.h>
using namespace std;
char s1[200005];
char s2[200005];
int vis[27];
int l[200005], r[200005];
int main() {
  scanf("%s%s", s1 + 1, s2 + 1);
  memset(vis, 0, sizeof vis);
  int len1 = strlen(s1 + 1);
  int len2 = strlen(s2 + 1);
  for (int i = 1; i <= len1; i++) {
    int p = s1[i] - 'a';
    l[i] = vis[p];
    if (s2[l[i] + 1] == s1[i]) l[i] = max(l[i], l[i] + 1);
    for (int j = i - 1; j > 0 && s1[j] != s1[i]; j--) {
      if (s2[l[j] + 1] == s1[i]) l[i] = max(l[i], l[j] + 1);
    }
    if (s1[i] == s2[1]) l[i] = max(1, l[i]);
    vis[p] = l[i];
  }
  for (int i = 1; i <= len1 / 2; i++) {
    swap(s1[i], s1[len1 - i + 1]);
  }
  for (int i = 1; i <= len2 / 2; i++) {
    swap(s2[i], s2[len2 - i + 1]);
  }
  memset(vis, 0, sizeof vis);
  for (int i = 1; i <= len1; i++) {
    int p = s1[i] - 'a';
    r[i] = vis[p];
    if (s2[r[i] + 1] == s1[i]) r[i] = max(r[i], r[i] + 1);
    for (int j = i - 1; j > 0 && s1[j] != s1[i]; j--) {
      if (s2[r[j] + 1] == s1[i]) r[i] = max(r[i], r[j] + 1);
    }
    if (s1[i] == s2[1]) r[i] = max(1, r[i]);
    vis[p] = r[i];
  }
  for (int i = 1; i <= len1 / 2; i++) swap(r[i], r[len1 - i + 1]);
  int flag = 1;
  for (int i = 1; i <= len1; i++) {
    if (l[i] + r[i] - 1 < len2) flag = 0;
  }
  if (flag)
    printf("Yes\n");
  else
    printf("No\n");
  return 0;
}
