If the said two people are believers, and they adhere to the laws of Islam in a regular way and do not insist on committing sins when they commit any, then they are considered as adil witnesses for a divorce. If the rest of the conditions are met, then the divorce is valid.