It is possible, you need to stay legally on the territory of Poland (you must have a biometric passport, visa or residence card).