#include <bits/stdc++.h>
const int mod = 1000000007;
const int inf = 1000000009;
const long long int INF = 1000000000000000009;
const long long big = 1000000000000000;
const long double eps = 0.0000000001;
using namespace std;
int DP[300005][19], T[300005];
int L[19];
int main() {
  ios::sync_with_stdio(false);
  cin.tie();
  cout.tie();
  int n, q;
  cin >> n >> q;
  for (int i = 1; i <= n; i++) {
    int a;
    cin >> a;
    T[i] = a;
    for (int j = 0; j <= 18; j++) {
      if (a & (1 << j)) {
        for (int k = 0; k <= 18; k++) DP[i][k] = max(DP[i][k], DP[L[j]][k]);
        L[j] = i;
        DP[i][j] = i;
      }
    }
  }
  for (int i = 1; i <= q; i++) {
    int a, b;
    cin >> a >> b;
    bool czy = false;
    for (int j = 0; j <= 18; j++)
      if (T[a] & (1 << j) && DP[b][j] >= a) {
        czy = true;
        cout << "Shi\n";
        break;
      }
    if (!czy) cout << "Fou\n";
  }
  return 0;
}
