#include <bits/stdc++.h>
using namespace std;
char s[210000], t[210000];
int dp[2][210000];
int cnt[300];
bool hp[30];
bool flag;
int lenS, lenT;
vector<int> myvec[30];
int work2(int x, int pos) {
  int l = 1, r = myvec[x].size() - 1;
  while (l < r) {
    int mid = (l + r) / 2;
    if (myvec[x][mid] == pos) return myvec[x][mid];
    if (myvec[x][mid] > pos)
      r = mid;
    else
      l = mid + 1;
  }
  return myvec[x][r];
}
int work1(int x, int pos) {
  int l = 0, r = myvec[x].size() - 2;
  while (l < r) {
    int mid = (l + r + 1) / 2;
    if (myvec[x][mid] == pos) return myvec[x][mid];
    if (myvec[x][mid] < pos)
      l = mid;
    else
      r = mid - 1;
  }
  return myvec[x][l];
}
void init() {
  scanf("%s", s);
  scanf("%s", t);
  lenS = strlen(s);
  lenT = strlen(t);
  flag = true;
  for (int i = 0; i < 26; ++i) myvec[i].push_back(-1);
  for (int i = 0; t[i]; ++i) {
    ++cnt[t[i]];
    hp[t[i] - 'a'] = true;
    myvec[t[i] - 'a'].push_back(i);
  }
  for (int i = 0; i < 26; ++i) {
    myvec[i].push_back(lenT);
    sort(myvec[i].begin(), myvec[i].end());
  }
  for (int i = 0; s[i]; ++i) {
    if (!hp[s[i] - 'a']) flag = false;
    --cnt[s[i]];
  }
  for (int i = 'a'; i <= 'z'; ++i)
    if (cnt[i] > 0) flag = false;
}
void dpwork() {
  if (s[0] == t[0])
    dp[0][0] = 1;
  else
    dp[0][0] = 0;
  for (int i = 1, j = dp[0][0]; flag && s[i]; ++i) {
    if (t[j] && s[i] == t[j]) {
      dp[0][i] = dp[0][i - 1] + 1;
      ++j;
    } else
      dp[0][i] = dp[0][i - 1];
  }
  dp[1][lenS] = 0;
  for (int i = lenS - 1, j = lenT - 1; flag && (~i); --i) {
    if ((~j) && s[i] == t[j]) {
      dp[1][i] = dp[1][i + 1] + 1;
      --j;
    } else
      dp[1][i] = dp[1][i + 1];
  }
  for (int i = 0; flag && s[i]; ++i) {
    int r1 = work1(s[i] - 'a', dp[0][i]) + 1,
        r2 = lenT - work2(s[i] - 'a', lenT - dp[1][i]);
    if (!i && (!r1 || r1 + dp[1][i + 1] < lenT))
      flag = false;
    else if ((!r1 || r1 + dp[1][i + 1] < lenT) &&
             (!r2 || r2 + dp[0][i - 1] < lenT))
      flag = false;
  }
  if (flag)
    puts("Yes");
  else
    puts("No");
}
int main() {
  init();
  dpwork();
  return 0;
}
