#include <bits/stdc++.h>
using namespace std;
string s, t;
int n, m, l[200009], r[200009], a[30][200009];
bool ans = true;
int main() {
  cin >> s >> t;
  n = s.length();
  m = t.length();
  s = ' ' + s + ' ';
  t = ' ' + t + ' ';
  l[0] = 0;
  for (int i = 1; i <= n; ++i) l[i] = l[i - 1] + int(t[l[i - 1] + 1] == s[i]);
  r[n + 1] = m + 1;
  for (int i = n; i >= 1; --i) r[i] = r[i + 1] - int(t[r[i + 1] - 1] == s[i]);
  for (int i = 0; i < 26; ++i)
    for (int j = 1; j <= m + 1; ++j)
      a[i][j] = a[i][j - 1] + int(t[j] - 'a' == i);
  for (int i = 1; i <= n; ++i)
    if (a[s[i] - 'a'][l[i - 1] + 1] -
            a[s[i] - 'a'][r[i + 1] - 2 < 0 ? 0 : r[i + 1] - 2] <=
        0) {
      ans = false;
      break;
    }
  if (ans)
    cout << "Yes";
  else
    cout << "No";
  cout << endl;
  return 0;
}
