#include <bits/stdc++.h>
using namespace std;
int l[2 * 111111];
int r[2 * 111111];
int cl[2 * 111111][30];
int main() {
  int sl, tl;
  int pos = 0;
  string s, t;
  getline(cin, s);
  getline(cin, t);
  sl = s.length();
  tl = t.length();
  for (int i = 1; i <= sl; ++i) {
    l[i] = l[i - 1];
    if (s[i - 1] == t[pos] && pos < tl) {
      l[i] = l[i - 1] + 1;
      ++pos;
    }
  }
  pos = tl - 1;
  for (int i = sl; i >= 1; --i) {
    r[i] = r[i + 1];
    if (s[i - 1] == t[pos] && pos >= 0) {
      r[i] = r[i + 1] + 1;
      --pos;
    }
  }
  for (int i = 1; i <= tl; ++i) {
    for (int j = 0; j <= 26; ++j)
      if (j == t[i - 1] - 'a')
        cl[i][j] = cl[i - 1][j] + 1;
      else
        cl[i][j] = cl[i - 1][j];
  }
  for (int i = 1; i <= sl; ++i) {
    if (l[i] + r[i] + 1 < tl ||
        (cl[l[i]][s[i - 1] - 'a'] - cl[tl - r[i]][s[i - 1] - 'a'] <= 0)) {
      cout << "No";
      return 0;
    }
  }
  cout << "Yes";
  return 0;
}
