#!/usr/bin/env python3
(s := input()), print("yes" if 0 < sum([s.startswith(input()) for _ in range(int(input()))]) else "no")
