#include <bits/stdc++.h>
using namespace std;
string s, t;
int a[30], x, y, n, m, r[200001], l[200001], kol[200001][26];
set<int> se;
int main() {
  cin >> s >> t;
  if (s.length() < t.length()) {
    cout << "No";
    return 0;
  }
  if (s == t) {
    cout << "Yes";
    return 0;
  }
  if (t[0] != s[0] || t[t.length() - 1] != s[s.length() - 1]) {
    cout << "No";
    return 0;
  }
  l[0] = 1;
  for (int i = 1; i < s.length(); i++) {
    if (l[i - 1] + 1 <= t.length() && s[i] == t[l[i - 1]])
      l[i] = l[i - 1] + 1;
    else
      l[i] = l[i - 1];
  }
  r[s.length() - 1] = 1;
  for (int i = s.length() - 2; i >= 0; i--) {
    if (r[i + 1] + 1 <= t.length() && s[i] == t[t.length() - r[i + 1] - 1])
      r[i] = r[i + 1] + 1;
    else
      r[i] = r[i + 1];
  }
  kol[0][t[0] - 'a']++;
  for (int i = 1; i < t.length(); i++) {
    for (int j = 0; j < 26; j++) {
      kol[i][j] = kol[i - 1][j];
    }
    kol[i][t[i] - 'a']++;
  }
  for (int i = 1; i < s.length() - 1; i++) {
    x = min((int)t.length() - 1, l[i - 1]);
    y = max(0, (int)t.length() - r[i + 1] - 1);
    if (y > 0) {
      x = kol[x][s[i] - 'a'] - kol[y - 1][s[i] - 'a'];
    } else {
      x = kol[x][s[i] - 'a'];
    }
    if (x > 0) m++;
  }
  m += 2;
  if (m == s.length())
    cout << "Yes";
  else
    cout << "No";
  return 0;
}
