#include <bits/stdc++.h>
using namespace std;
const int N = 200005;
char s[N], t[N];
int l[N], r[N];
int ok[300];
int main() {
  while (scanf("%s%s", s, t) == 2) {
    memset(ok, -1, sizeof(ok));
    int slen = strlen(s);
    int tlen = strlen(t);
    int pos = 0;
    bool flag = true;
    for (int i = 0; i < slen; ++i) {
      if (pos < tlen && s[i] == t[pos]) {
        ok[s[i]] = pos;
        l[i] = pos++;
      } else {
        if (ok[s[i]] == -1) {
          flag = false;
        }
        l[i] = ok[s[i]];
      }
    }
    if (!flag) {
      puts("No");
      continue;
    }
    memset(ok, -1, sizeof(ok));
    pos = tlen - 1;
    for (int i = slen - 1; i >= 0; --i) {
      if (pos >= 0 && s[i] == t[pos]) {
        ok[s[i]] = pos;
        r[i] = pos--;
      } else {
        if (ok[s[i]] == -1) {
          flag = false;
        }
        r[i] = ok[s[i]];
      }
    }
    if (!flag) {
      puts("No");
      continue;
    }
    for (int i = 0; i < slen; ++i) {
      if (l[i] < r[i]) {
        flag = false;
        break;
      }
    }
    if (!flag)
      puts("No");
    else
      puts("Yes");
  }
  return 0;
}
