# Right distribution of classes for binary classification?

For a binary classification, let's say we have samples from two classes, namely class A and class B. Is it a must to have the same number of samples from each class? i.e. Is it a bad practice to have a dataset of 30% A & 70% B for a machine learning problem?