#include <bits/stdc++.h>
using namespace std;
const int N = 200010;
int l[N], r[N];
string s, t;
int cnt[1100];
int ct[N][26];
int main() {
  cin >> s >> t;
  int n = s.size(), m = t.size();
  for (auto c : t) cnt[c] = 1;
  for (int i = 0; i < t.size(); i++) {
    for (int j = 0; j < 26; j++) ct[i + 1][j] = ct[i][j] + ((t[i] - 'a') == j);
  }
  for (int i = 1; i <= n; i++) {
    if (!cnt[s[i - 1]]) {
      puts("No");
      return 0;
    }
    if (l[i - 1] == t.size())
      l[i] = l[i - 1];
    else
      l[i] = l[i - 1] + (s[i - 1] == t[l[i - 1]]);
  }
  for (int i = n; i >= 1; i--) {
    if (r[i + 1] == t.size())
      r[i] = r[i + 1];
    else
      r[i] = r[i + 1] + (s[i - 1] == t[t.size() - (r[i + 1] + 1)]);
  }
  for (int i = 1; i <= s.size(); i++) r[i] = t.size() - r[i] + 1;
  bool flag = true;
  for (int i = 1; i <= s.size(); i++) {
    if (l[i] < r[i] ||
        !(ct[l[i]][s[i - 1] - 'a'] - ct[r[i] - 1][s[i - 1] - 'a'])) {
      flag = false;
    }
  }
  if (flag)
    puts("Yes");
  else
    puts("No");
  return 0;
}
