Hammad said about a person who prays facing a direction other than the qiblah: His prayer is done (valid).