#include <bits/stdc++.h>
using namespace std;
long long int em(long long int x, long long int Mod, long long int n) {
  if (n == 0)
    return 1ll;
  else if (n % 2 == 0)
    return em((x % Mod * x % Mod) % Mod, Mod, n / 2) % Mod;
  else
    return (x % Mod * em((x % Mod * x % Mod) % Mod, Mod, (n - 1) / 2)) % Mod;
}
void fun(string s, string s1) {
  long long int i, j, k;
  long long int l1, l2;
  l1 = s.length();
  l2 = s1.length();
  long long int matchedidx[l1 + 1];
  long long int tomatchidx[l1 + 1];
  if (l1 < l2) {
    cout << "No\n";
    return;
  }
  if (s[0] != s1[0]) {
    cout << "No\n";
    return;
  }
  if (s[l1 - 1] != s1[l2 - 1]) {
    cout << "No\n";
    return;
  }
  matchedidx[0] = 0;
  j = 1;
  for (i = 1; i < l1; i++) {
    if (j < l2 && (s1[j] == s[i])) j++;
    matchedidx[i] = j - 1;
  }
  tomatchidx[l1 - 1] = l2 - 1;
  j = l2 - 2;
  for (i = l1 - 2; i >= 0; i--) {
    if (j >= 0 && (s1[j] == s[i])) j--;
    tomatchidx[i] = j + 1;
  }
  long long int freq[l2][27];
  memset(freq, 0, sizeof(freq));
  for (i = 0; i < l2; i++) {
    freq[i][s1[i] - 'a']++;
    if (i > 0) {
      for (j = 0; j < 26; j++) freq[i][j] += freq[i - 1][j];
    }
  }
  for (i = 1; i < l1 - 1; i++) {
    long long int exr = max(0ll, tomatchidx[i + 1] - 1);
    long long int exl = min(l2 - 1, matchedidx[i - 1] + 1);
    long long int count =
        (freq[exl][s[i] - 'a'] - ((exr > 0) ? freq[exr - 1][s[i] - 'a'] : 0));
    if (exr > exl || count == 0) {
      cout << "No\n";
      return;
    }
  }
  cout << "Yes\n";
}
int32_t main() {
  std::ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  string str, str1;
  cin >> str;
  cin >> str1;
  fun(str, str1);
}
