First, yoga is not in any way about how flexible you are. Yoga is about creating inner peace in the body. We practice yoga to release tension and stress out of the body so that we can live free of pain. You can sit cross legged, on the floor, for one hour, in one pose and you are doing yoga. You can do a hundred yoga poses in one hour, getting up and down off the floor, stand on your head and sweat buckets and not be doing yoga. Doing yoga depends on where your mind is. If your mind consistently wanders during yoga, you are not effectively doing yoga. (However, it will take some time to train the brain to be still enough to sit for one hour without any distracting thoughts.)
Second, flexibility comes with gentle practice. It takes time to teach the body flexibility. It will not come from one or two classes, you have to train the muscles to "let go." At first, when you bend over to touch your toes, they may seem miles away, your legs, glutes and lower back may scream at you because they are so tight that they don't know what you are doing. At this point you want to only bend as far as you can, and rest there for a minute or two. By doing this regularly, your body will begin to understand how to bend. The muscles will become pliant and you will move farther and farther into the stretch and closer and closer to your toes! When I began my yoga journey, I could not touch my toes! Now, after years of doing and teaching yoga, I am able to bend with ease, to get my palms to the floor, and I enjoy the way it feels in my body.
I encourage those who think they are not flexible enough to do yoga, to step out of their comfort zone and try a couple of classes! I know it can be challenging to step into a room full of new people who are moving their bodies in ways you've never thought of, but EVERYONE had to take their first step. And you may be surprised at what you find.