#include <bits/stdc++.h>
using namespace std;
int forw[200500], rev[200500];
vector<int> pos[26];
void no() {
  cout << "No";
  exit(0);
}
int main() {
  string s, t;
  cin >> s >> t;
  int n = s.size(), m = t.size();
  for (int i = 0; i < m; i++) pos[t[i] - 'a'].push_back(i);
  if (s[0] != t[0] or s[s.size() - 1] != t[t.size() - 1] or s.size() < t.size())
    no();
  forw[0] = rev[n - 1] = 1;
  for (int i = 1; i < n; i++) {
    if (forw[i - 1] < m)
      forw[i] = forw[i - 1] + (s[i] == t[forw[i - 1]]);
    else
      forw[i] = m;
  }
  for (int i = n - 2; i >= 0; i--) {
    if (rev[i + 1] < m)
      rev[i] = rev[i + 1] + (s[i] == t[m - 1 - rev[i + 1]]);
    else
      rev[i] = m;
  }
  for (int i = 1; i < n - 1; i++) {
    int bound = forw[i - 1];
    int let = s[i] - 'a';
    int idx;
    idx = upper_bound(pos[let].begin(), pos[let].end(), bound) -
          pos[let].begin() - 1;
    if (idx >= 0) {
      if (pos[let][idx] + 1 + rev[i + 1] < m) no();
    } else
      no();
  }
  cout << "Yes";
  return 0;
}
