/* package whatever; // don't place package name! */

import java.util.*;
import java.lang.*;
import java.io.*;

/* Name of the class has to be "Main" only if the class is public. */
class Ideone
{
	
	public static boolean match(String s, String p) {
		String us = s.toUpperCase();
		int i = 0;
		for (char c : p.toUpperCase().toCharArray()) {
			int next = us.indexOf(c, i);
			if (next < 0) {
				return false;
			}
			i = next+1;
		}
		return true;
	}

	public static void main (String[] args) throws java.lang.Exception {
		System.out.println(match("quick brown fox", "qbfx"));
		System.out.println(match("quick brown fox", "qbfy"));
	}
}