#include <bits/stdc++.h>
using namespace std;
char s[211111], t[211111];
int l[211111], r[211111];
int pos[27][211111], size_[27], memo[27];
int main() {
  gets(s + 1);
  gets(t + 1);
  s[0] = '0';
  t[0] = '0';
  int size = strlen(s), sizeT = strlen(t);
  for (int i = 1; i < sizeT; i++) {
    pos[t[i] - 'a'][size_[t[i] - 'a']++] = i;
  }
  l[0] = 0;
  for (int i = 1; i < size; i++) {
    l[i] = l[i - 1];
    if (s[i] == t[l[i] + 1]) l[i]++;
  }
  for (int i = size - 1; i >= 1; i--) {
    r[i] = r[i + 1];
    if (s[i] == t[sizeT - r[i] - 1]) r[i]++;
  }
  bool ok;
  for (int i = 1; i < size; i++) {
    int m = size_[s[i] - 'a'];
    ok = 0;
    for (int j = memo[s[i] - 'a']; j < m; j++) {
      int p = pos[s[i] - 'a'][j];
      if (p <= l[i - 1] + 1 && p >= sizeT - r[i + 1] - 1) {
        ok = 1;
        break;
      }
      memo[s[i] - 'a']++;
    }
    if (!ok) break;
  }
  if (!ok)
    printf("No\n");
  else
    printf("Yes\n");
}
