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

public class MaartenBackwardsDPHashSet {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        int n = sc.nextInt();
        HashSet<String> words = new HashSet<>();
        for (int i = 0; i < n; ++i) words.add(sc.next());
        int L = s.length();
        boolean[] human = new boolean[L + 1];
        human[0] = true;
        for (int j = 6; j <= L; ++j) {
            int start = Math.max(0, j - 10);
            for (int i = start; i < j - 5; ++i) {
                if (human[i] && words.contains(s.substring(i, j))) {
                    human[j] = true;
                    break;
                }
            }
        }
        System.out.println(human[L] ? "yes" : "no");
    }
}
