#include <bits/stdc++.h>
using namespace std;
const int maxn = 200005;
string s, t;
int pre[maxn][26], pos[26];
int f[maxn];
int g[maxn];
void solve(string &s, string &t, int f[]) {
  for (int i = 0; i < 26; i++) pos[i] = -1;
  int n = t.size(), m = s.size();
  for (int i = 0; i <= n; i++) {
    for (int j = 0; j < 26; j++) {
      pre[i][j] = pos[j];
    }
    if (i < n) pos[t[i] - 'a'] = i;
  }
  int len = 0;
  for (int i = 0; i < m; i++) {
    if (len < n && s[i] == t[len]) {
      f[i] = ++len;
    } else {
      f[i] = pre[len][s[i] - 'a'] + 1;
    }
  }
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> s >> t;
  solve(s, t, f);
  reverse(s.begin(), s.end());
  reverse(t.begin(), t.end());
  solve(s, t, g);
  bool ok = true;
  int m = s.size(), n = t.size();
  for (int i = 0; i < m; i++) {
    if (f[i] + g[m - i - 1] - 1 < n) {
      ok = false;
      break;
    }
  }
  if (ok)
    cout << "Yes\n";
  else
    cout << "No\n";
  return 0;
}
