#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 10;
const int INF = 1e9 + 7;
int fw[N], bk[N];
vector<int> pos[26];
void solve() {
  string a, b;
  cin >> a >> b;
  int lenA = a.length(), lenB = b.length();
  for (int i = 0; i < lenB; i++) {
    pos[b[i] - 'a'].push_back(i);
  }
  for (int i = 0; i < 26; i++) sort(pos[i].begin(), pos[i].end());
  int i = 0, j = 0;
  for (int i = 0; i < N; i++) {
    fw[i] = -1;
    bk[i] = lenB + 1;
  }
  while (i < lenA) {
    if (j < lenB) {
      if (a[i] == b[j]) {
        i++;
        j++;
        fw[i - 1] = j - 1;
        continue;
      }
    }
    if (i > 0) fw[i] = fw[i - 1];
    i++;
  }
  if (j < lenB) {
    cout << "NO\n";
    return;
  }
  i = lenA - 1, j = lenB - 1;
  while (i >= 0) {
    if (j >= 0) {
      if (a[i] == b[j]) {
        i--;
        j--;
        bk[i + 1] = j + 1;
        continue;
      }
    }
    bk[i] = bk[i + 1];
    i--;
  }
  int ans = 0;
  for (int i = 0; i < lenA; i++) {
    if (i == 0) {
      if (b[0] == a[i] && bk[i + 1] <= lenB + 1) ans++;
    } else if (i == lenA - 1) {
      if (b[lenB - 1] == a[i] && fw[i - 1] >= lenB - 2) ans++;
    } else {
      int pres = fw[i - 1] - bk[i + 1] + 2;
      if (pres < 0) continue;
      if (pres == 0) {
        if (a[i] == b[fw[i - 1] + 1]) ans++;
        continue;
      }
      int ch = a[i] - 'a';
      int l = 0, r = pos[ch].size() - 1, res = -1;
      while (l <= r) {
        int mid = (l + r) >> 1;
        if (pos[ch][mid] >= bk[i + 1] - 1) {
          r = mid - 1;
          res = mid;
        } else
          l = mid + 1;
      }
      if (res >= 0) {
        res = pos[ch][res];
        if (res <= fw[i - 1] + 1 && res >= bk[i + 1] - 1) ans++;
      }
    }
  }
  if (ans == lenA)
    cout << "Yes\n";
  else
    cout << "No\n";
  return;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  solve();
  return 0;
}
