#include <bits/stdc++.h>
using namespace std;
char s[200010];
char t[200010];
int front[200010];
int back[200010];
int pos[256];
int main() {
  scanf("%s", s + 1);
  scanf("%s", t + 1);
  int lens = strlen(s + 1), lent = strlen(t + 1), i, j = 1;
  memset(pos, 0, sizeof(pos));
  for (i = 1; i <= lens; ++i) {
    if (j <= lent && t[j] == s[i]) {
      pos[s[i]] = j;
      j++;
    }
    front[i] = pos[s[i]];
  }
  memset(pos, 0, sizeof(pos));
  j = lent;
  for (i = lens; i > 0; --i) {
    if (j > 0 && t[j] == s[i]) {
      pos[s[i]] = lent - j + 1;
      j--;
    }
    back[i] = pos[s[i]];
  }
  bool flag = true;
  for (i = 1; i <= lens && flag; ++i) {
    if (front[i] + back[i] <= lent) flag = false;
  }
  printf("%s\n", flag ? "Yes" : "No");
  return 0;
}
