#include <bits/stdc++.h>
using namespace std;
int l[2000001], r[2000001];
inline int num(char r) { return int(r) - int('a'); }
vector<int> q[30];
int main() {
  string s, t;
  cin >> s >> t;
  int n = int(s.length());
  for (int i = 0; i < 2000001; i++) l[i] = r[i] = 0;
  for (int i = 0; i < int(t.size()); i++) q[num(t[i])].push_back(i);
  l[0] = int(s[0] == t[0]);
  for (int i = 1; i < n; i++) {
    l[i] = l[i - 1];
    if (s[i] == t[l[i]]) l[i]++;
  }
  r[n - 1] = int(s[n - 1] == t[int(t.size()) - 1]);
  for (int i = n - 2; i >= 0; i--) {
    r[i] = r[i + 1];
    if (s[i] == t[int(t.size()) - 1 - r[i]]) r[i]++;
  }
  for (int i = 0; i < n; i++) {
    int left = 0, right = int(q[num(s[i])].size());
    while (right - left > 1) {
      int middle = (left + right) / 2;
      int m = q[num(s[i])][middle];
      if (l[i - 1] < m)
        right = middle;
      else
        left = middle;
    }
    if (int(q[num(s[i])].size()) == 0) {
      cout << "No" << endl;
      return 0;
    }
    left = q[num(s[i])][left];
    if (l[i - 1] < left || r[i + 1] < int(t.size()) - left - 1) {
      cout << "No" << endl;
      return 0;
    }
  }
  cout << "Yes" << endl;
  return 0;
}
