#include <bits/stdc++.h>
using namespace std;
const int MAXN = (int)(2e5 + 5);
const long long MOD = (long long)(1e9 + 7);
int t;
int l[200010];
int r[200010];
int pos[27];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  t = 1;
  while (t--) {
    string s, t;
    cin >> s >> t;
    int n = s.size();
    int m = t.size();
    memset(pos, -1, sizeof(pos));
    for (int i = 0, j = 0; i < n; i++) {
      if (j < m and s[i] == t[j])
        l[i] = j, pos[s[i] - 'a'] = j++;
      else
        l[i] = pos[s[i] - 'a'];
    }
    memset(pos, 0x3f, sizeof(pos));
    for (int i = n - 1, j = m - 1; i >= 0; i--) {
      if (j >= 0 and s[i] == t[j])
        r[i] = j, pos[s[i] - 'a'] = j--;
      else
        r[i] = pos[s[i] - 'a'];
    }
    int cnt = 0;
    for (int i = 0; i < n; i++) {
      cnt += l[i] >= r[i];
    }
    cnt == n ? cout << "Yes"
                    << "\n"
             : cout << "No"
                    << "\n";
  }
  return 0;
}
