Answering yes will not automatically disqualify you even if you are from an 'unfriendly country'. Unless you have done something really bad you should be fine, they are pretty understanding. Don't go into a lot of detail, just put it down in as few words as possible, no need to mention if you went to jail. Better not to lie even if it feels like they will never find out. If they are concerned they will probably ask you for more details or clarification.