#include <bits/stdc++.h>
using namespace std;
const int MAX = 2e5 + 9;
void N() {
  cout << "No\n";
  exit(0);
}
string s, t;
int n, m, pos[MAX], pr[MAX][27], f[MAX][27], pre[MAX], p;
void ad(int x, int val, int id) {
  for (x++; x <= n + 1; x += x & -x) f[x][id] += val;
}
int gt(int x, int id) {
  int ret = 0;
  for (x++; x; x -= x & -x) ret += f[x][id];
  return ret;
}
int main() {
  ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  cin >> s >> t, n = s.size(), m = t.size();
  if (n < m) N();
  for (int i = 0; i < n && p < m; i++)
    if (s[i] == t[p]) pre[p] = i, p++;
  if (p != m) N();
  for (int i = 0; i < n; i++)
    for (int j = 'a'; j <= 'z'; j++)
      if (s[i] == j)
        pr[i][j - 'a'] = i;
      else
        pr[i][j - 'a'] = i ? pr[i - 1][j - 'a'] : -1;
  pos[m] = n;
  for (int i = m - 1; i >= 0; i--) {
    pos[i] = pr[pos[i + 1] - 1][t[i] - 'a'];
    ad(pre[i], +1, t[i] - 'a');
    ad(pos[i] + 1, -1, t[i] - 'a');
  }
  for (int i = 0; i < n; i++)
    if (!gt(i, s[i] - 'a')) N();
  cout << "Yes";
}
