#include <bits/stdc++.h>
using namespace std;
char s[200010], t[200010];
int maxmatch[2][200010];
void gao(int dp[]) {
  memset(dp, 0, sizeof dp);
  int ls = strlen(s), lt = strlen(t);
  vector<int> charlist[26];
  int idlist[26];
  int lastpos[26];
  for (int i = 0; i < 26; ++i) charlist[i].clear();
  for (int i = 0; i < lt; ++i) {
    charlist[t[i] - 'a'].push_back(i);
  }
  for (int i = 0; i < 26; ++i) {
    if (charlist[i].size())
      idlist[i] = 0;
    else
      idlist[i] = -1;
    lastpos[i] = -1;
  }
  for (int i = 0; i < ls; ++i) {
    if (lastpos[s[i] - 'a'] >= 0) dp[i] = dp[lastpos[s[i] - 'a']];
    lastpos[s[i] - 'a'] = i;
    if (charlist[s[i] - 'a'].size() == 0 || idlist[s[i] - 'a'] == -1) {
      dp[i] = 0;
      continue;
    }
    if (idlist[s[i] - 'a'] >= charlist[s[i] - 'a'].size()) {
      dp[i] = charlist[s[i] - 'a'].back() + 1;
      continue;
    }
    int targetpos = charlist[s[i] - 'a'][idlist[s[i] - 'a']];
    if (targetpos == 0) {
      dp[i] = 1;
      ++idlist[s[i] - 'a'];
      continue;
    }
    char prevchar = t[targetpos - 1];
    int prevcharpos = lastpos[prevchar - 'a'];
    if (prevcharpos >= 0 && dp[prevcharpos] >= targetpos) {
      dp[i] = targetpos + 1;
      ++idlist[s[i] - 'a'];
    }
  }
  for (int i = 0; i < ls; ++i) {
  }
}
int main() {
  while (scanf("%s%s", s, t) != EOF) {
    int ls = strlen(s), lt = strlen(t);
    gao(maxmatch[0]);
    reverse(s, s + ls);
    reverse(t, t + lt);
    gao(maxmatch[1]);
    bool valid = true;
    for (int i = 0; i < ls; ++i) {
      if (maxmatch[1][i] + maxmatch[0][ls - 1 - i] < lt + 1) {
        valid = false;
        break;
      }
    }
    printf("%s\n", valid ? "Yes" : "No");
  }
  return 0;
}
